• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TMD-Maker(T字形ER図作成ツール)のEclipse Plugin版


Commit MetaInfo

Révisiona6ca5667f04c91f0dc0d239527916248254cf97d (tree)
l'heure2014-03-28 14:24:12
Auteurnakag <nakag@user...>
Commiternakag

Message de Log

Merge branch 'release-0.2.8'

Change Summary

Modification

--- a/tmdmaker.ddlgenerator/.classpath
+++ b/tmdmaker.ddlgenerator/.classpath
@@ -1,8 +1,8 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <classpath>
3- <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.5.jar"/>
4- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
5- <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.5.jar"/>
3+ <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.6.jar"/>
4+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
5+ <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.6.jar"/>
66 <classpathentry exported="true" kind="lib" path="lib/ddlutils-1.1.jar"/>
77 <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar"/>
88 <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.3.jar"/>
--- /dev/null
+++ b/tmdmaker.ddlgenerator/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
1+eclipse.preferences.version=1
2+org.eclipse.jdt.ui.javadoc=false
3+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright 2009-2014 TMD-Maker Project &lt;http\://tmdmaker.sourceforge.jp/&gt;\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the "License");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http\://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an "AS IS" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\r\n * {@inheritDoc}\r\n * \r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
--- a/tmdmaker.ddlgenerator/META-INF/MANIFEST.MF
+++ b/tmdmaker.ddlgenerator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker's DDLGenerator with DdlUtils
44 Bundle-SymbolicName: tmdmaker.ddlgenerator;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Require-Bundle: org.eclipse.core.runtime,
77 tmdmaker;bundle-version="0.2.0",
88 org.eclipse.ui,
@@ -22,9 +22,9 @@ Bundle-ClassPath: .,
2222 lib/stax-api-1.0.1.jar,
2323 lib/wstx-asl-3.0.2.jar,
2424 lib/ddlutils-1.1.jar,
25- lib/jcl-over-slf4j-1.7.5.jar,
26- lib/slf4j-api-1.7.5.jar,
27- lib/slf4j-simple-1.7.5.jar
25+ lib/jcl-over-slf4j-1.7.6.jar,
26+ lib/slf4j-api-1.7.6.jar,
27+ lib/slf4j-simple-1.7.6.jar
2828 Export-Package: jp.sourceforge.tmdmaker.dialect,
2929 jp.sourceforge.tmdmaker.generate
3030 Bundle-Vendor: TMD-Maker Project
Binary files a/tmdmaker.ddlgenerator/lib/jcl-over-slf4j-1.7.5.jar and b/tmdmaker.ddlgenerator/lib/jcl-over-slf4j-1.7.6.jar differ
Binary files a/tmdmaker.ddlgenerator/lib/slf4j-api-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.ddlgenerator/lib/slf4j-api-1.7.6.jar differ
Binary files a/tmdmaker.ddlgenerator/lib/slf4j-simple-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.ddlgenerator/lib/slf4j-simple-1.7.6.jar differ
--- a/tmdmaker.ddlgenerator/src/jp/sourceforge/tmdmaker/generate/DdlUtilsConverter.java
+++ b/tmdmaker.ddlgenerator/src/jp/sourceforge/tmdmaker/generate/DdlUtilsConverter.java
@@ -1,380 +1,382 @@
1-/*
2- * Copyright 2009-2013 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package jp.sourceforge.tmdmaker.generate;
17-
18-import java.util.ArrayList;
19-import java.util.HashMap;
20-import java.util.List;
21-import java.util.Map;
22-
23-import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
24-import jp.sourceforge.tmdmaker.model.DataTypeDeclaration;
25-import jp.sourceforge.tmdmaker.model.Diagram;
26-import jp.sourceforge.tmdmaker.model.IAttribute;
27-import jp.sourceforge.tmdmaker.model.IdentifierRef;
28-import jp.sourceforge.tmdmaker.model.KeyModel;
29-import jp.sourceforge.tmdmaker.model.ModelElement;
30-import jp.sourceforge.tmdmaker.model.ReusedIdentifier;
31-import jp.sourceforge.tmdmaker.model.SarogateKeyRef;
32-import jp.sourceforge.tmdmaker.model.StandardSQLDataType;
33-import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
34-
35-import org.apache.ddlutils.model.Column;
36-import org.apache.ddlutils.model.Database;
37-import org.apache.ddlutils.model.ForeignKey;
38-import org.apache.ddlutils.model.Index;
39-import org.apache.ddlutils.model.IndexColumn;
40-import org.apache.ddlutils.model.NonUniqueIndex;
41-import org.apache.ddlutils.model.Reference;
42-import org.apache.ddlutils.model.Table;
43-import org.apache.ddlutils.model.UniqueIndex;
44-import org.slf4j.Logger;
45-import org.slf4j.LoggerFactory;
46-
47-/**
48- * TMのモデルをDdlUtilsのモデルへ変換するクラス
49- *
50- * @author nakaG
51- *
52- */
53-public class DdlUtilsConverter {
54- /** logging */
55- private static Logger logger = LoggerFactory
56- .getLogger(DdlUtilsConverter.class);
57- /** 外部キーのテーブル */
58- private Map<Table, Map<String, List<Reference>>> foreignTables;
59-
60- /** 外部キーを出力するか */
61- private boolean foreignKeyEnabled;
62-
63- /**
64- * コンストラクタ
65- */
66- public DdlUtilsConverter() {
67- this(false);
68- }
69-
70- /**
71- * コンストラクタ
72- *
73- * @param foreignKeyEnabled
74- * 外部キーを出力する場合trueを渡す。
75- */
76- public DdlUtilsConverter(boolean foreignKeyEnabled) {
77- foreignTables = new HashMap<Table, Map<String, List<Reference>>>();
78- this.foreignKeyEnabled = foreignKeyEnabled;
79- }
80-
81- /**
82- * TMD-MakerのモデルをDDLUtilsのデータベースモデルへ変換する
83- *
84- * @param diagram
85- * TMD-Makerのルートモデル
86- * @return DDLUtilsのルートモデル
87- */
88- public Database convert(Diagram diagram, List<AbstractEntityModel> models) {
89- Database database = createDatabase(diagram);
90-
91- addModels(database, models);
92-
93- if (foreignKeyEnabled) {
94- addForeignKeys(database);
95- }
96- return database;
97- }
98-
99- private Database createDatabase(Diagram diagram) {
100- Database database = new Database();
101- database.setName(diagram.getName());
102- return database;
103- }
104-
105- private void addModels(Database database, List<AbstractEntityModel> models) {
106- for (AbstractEntityModel model : models) {
107- addModel(database, model);
108- }
109- }
110-
111- /**
112- * TMD-MakerのモデルをDDLUtilsのテーブルモデルとして追加する
113- *
114- * @param database
115- * DDLUtilsのルートモデル
116- * @param model
117- * TMD-Makerのモデル
118- */
119- private void addModel(Database database, ModelElement model) {
120- if (!(model instanceof AbstractEntityModel)) {
121- return;
122- }
123- AbstractEntityModel entity = (AbstractEntityModel) model;
124- if (entity.isNotImplement()) {
125- return;
126- }
127- database.addTable(convert(entity));
128- }
129-
130- /**
131- * TMD-MakerのモデルをDDLUtilsのテーブルモデルへ変換する
132- *
133- * @param entity
134- * TMD-Makerのモデル
135- * @return DDLUtilsのテーブルモデル
136- */
137- private Table convert(AbstractEntityModel entity) {
138- // テーブル名を指定
139- Table table = new Table();
140- table.setName(entity.getImplementName());
141- table.setDescription(entity.getName());
142-
143- // 実装対象のアトリビュートをカラムとして追加
144- Map<IAttribute, Column> attributeColumnMap = new HashMap<IAttribute, Column>();
145- addColumns(entity, table, attributeColumnMap);
146-
147- // キーをインデックスとして追加
148- addIndices(entity, table, attributeColumnMap);
149-
150- /*
151- * テーブル名 -> 参照テーブル名 -> リファレンス のリストを作成する。 あとでループして各テーブルで 外部キーを作成して追加する。
152- */
153- setupForeignTables(entity, table);
154-
155- return table;
156- }
157-
158- /**
159- * カラムを追加する
160- *
161- * @param entity
162- * 対象エンティティ
163- * @param table
164- * 対象テーブル
165- * @param attributeColumnMap
166- * アトリビュートとカラムのマップ
167- */
168- private void addColumns(AbstractEntityModel entity, Table table,
169- Map<IAttribute, Column> attributeColumnMap) {
170- List<IAttribute> attributes = ImplementRule
171- .findAllImplementAttributes(entity);
172- for (IAttribute a : attributes) {
173- Column column = convert(a);
174- table.addColumn(column);
175- attributeColumnMap.put(a, column);
176- }
177- }
178-
179- /**
180- * 外部キーテーブルを初期化する
181- *
182- * @param entity
183- * 対象モデル
184- * @param table
185- * 対象テーブル
186- */
187- private void setupForeignTables(AbstractEntityModel entity, Table table) {
188- Map<String, List<Reference>> foreinReferences = new HashMap<String, List<Reference>>();
189-
190- for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity
191- .getReusedIdentifieres().entrySet()) {
192-
193- AbstractEntityModel foreignEntity = reusedMap.getKey();
194- ReusedIdentifier reused = reusedMap.getValue();
195-
196- List<Reference> refences = new ArrayList<Reference>();
197-
198- if (reused.isSarogateKeyEnabled()) {
199- for (SarogateKeyRef sref : reused.getSarogateKeys()) {
200- Column localColumn = convert(sref);
201- Column originalColumn = convert(sref.getOriginal());
202- addReference(refences, localColumn, originalColumn);
203- }
204- } else {
205- for (IdentifierRef iref : reused.getIdentifires()) {
206- Column localColumn = convert(iref);
207- Column originalColumn = convert(iref.getOriginal());
208- addReference(refences, localColumn, originalColumn);
209- }
210- }
211- foreinReferences.put(foreignEntity.getImplementName(), refences);
212- }
213-
214- foreignTables.put(table, foreinReferences);
215- }
216-
217- private void addReference(List<Reference> refences, Column localColumn,
218- Column originalColumn) {
219- Reference reference = new Reference(localColumn, originalColumn);
220- refences.add(reference);
221- logger.debug("参照: " + localColumn.getName() + "->"
222- + originalColumn.getName());
223- }
224-
225- /**
226- * 外部キー制約を設定する
227- *
228- * @param database
229- * 対象データベース
230- */
231- private void addForeignKeys(Database database) {
232- for (Map.Entry<Table, Map<String, List<Reference>>> foreignRefrences : foreignTables
233- .entrySet()) {
234- Table table = foreignRefrences.getKey();
235- Integer fidx = 0;
236-
237- for (Map.Entry<String, List<Reference>> foreignmap : foreignRefrences
238- .getValue().entrySet()) {
239- String tableName = foreignmap.getKey();
240- fidx += 1;
241- ForeignKey foreignKey = new ForeignKey("FK_" + tableName
242- + fidx.toString());
243-
244- for (Reference ref : foreignmap.getValue()) {
245- foreignKey.addReference(ref);
246- }
247- foreignKey.setForeignTable(database.findTable(tableName));
248- table.addForeignKey(foreignKey);
249- }
250- }
251- }
252-
253- /**
254- * インデックスを追加する
255- *
256- * @param entity
257- * 対象エンティティ
258- * @param table
259- * 対象テーブル
260- * @param attributeColumnMap
261- * アトリビュートとカラムのマップ
262- */
263- private void addIndices(AbstractEntityModel entity, Table table,
264- Map<IAttribute, Column> attributeColumnMap) {
265- for (KeyModel idx : entity.getKeyModels()) {
266-
267- // マスターキーはプライマリキーとして登録する
268- if (idx.isMasterKey()) {
269- markPrimaryKeys(table, idx);
270- } else {
271- table.addIndex(convert(idx, attributeColumnMap));
272- }
273- }
274- }
275-
276- /**
277- * マスターキーのカラムにプライマリキーに設定する
278- *
279- * @param table
280- * 対象テーブル
281- * @param idx
282- * マスターキー
283- */
284- private void markPrimaryKeys(Table table, KeyModel idx) {
285- for (IAttribute a : idx.getAttributes()) {
286- Column c = table.findColumn(a.getImplementName());
287- if (c != null) {
288- c.setPrimaryKey(true);
289- }
290- }
291- }
292-
293- /**
294- * TMD-MakerのキーモデルをDDLUtilsのインデックスモデルへ変換する
295- *
296- * @param key
297- * TMD-Makerのアトリビュートモデル
298- * @return DDLUtilsのインデックスモデル
299- */
300- private Index convert(KeyModel key,
301- Map<IAttribute, Column> attributeColumnMap) {
302- Index index = null;
303- if (key.isUnique()) {
304- index = new UniqueIndex();
305- } else {
306- index = new NonUniqueIndex();
307- }
308- index.setName(key.getName());
309-
310- for (IAttribute attr : key.getAttributes()) {
311- Column column = attributeColumnMap.get(attr);
312- if (column != null) {
313- IndexColumn indexColumn = new IndexColumn(column);
314- index.addColumn(indexColumn);
315- } else {
316- logger.error("column not found." + attr.getName());
317- }
318- }
319-
320- return index;
321- }
322-
323- /**
324- * TMD-MakerのアトリビュートモデルをDDLUtilsのカラムモデルへ変換する
325- *
326- * @param entity
327- * TMD-Makerのアトリビュートモデル
328- * @return DDLUtilsのカラムモデル
329- */
330- private Column convert(IAttribute attribute) {
331- Column column = new Column();
332- column.setName(attribute.getImplementName());
333- DataTypeDeclaration dtd = attribute.getDataTypeDeclaration();
334- if (dtd != null) {
335- StandardSQLDataType dataType = dtd.getLogicalType();
336- column.setTypeCode(dataType.getSqlType());
337- if (dataType.isSupportSize() && dtd.getSize() != null) {
338- column.setSize(dtd.getSize().toString());
339- }
340- if (dataType.isSupportScale() && dtd.getScale() != null) {
341- column.setScale(dtd.getScale().intValue());
342- }
343- }
344- column.setRequired(!attribute.isNullable());
345- return column;
346- }
347-
348- /**
349- * 全てのテーブルへ共通属性を追加する。
350- *
351- * @param database
352- * 全テーブルを保持するデータベースモデル
353- * @param commonAttributes
354- * 共通属性
355- */
356- public void addCommonColumns(Database database,
357- List<IAttribute> commonAttributes) {
358- if (commonAttributes == null) {
359- return;
360- }
361- for (Table t : database.getTables()) {
362- addCommonColumns(t, commonAttributes);
363- }
364- }
365-
366- /**
367- * 共通属性をカラムへ変換してテーブルへ追加する。
368- *
369- * @param t
370- * テーブル
371- * @param commonAttributes
372- * 共通属性
373- */
374- private void addCommonColumns(Table t, List<IAttribute> commonAttributes) {
375-
376- for (IAttribute a : commonAttributes) {
377- t.addColumn(convert(a));
378- }
379- }
380-}
1+/*
2+ * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package jp.sourceforge.tmdmaker.generate;
17+
18+import java.util.ArrayList;
19+import java.util.HashMap;
20+import java.util.List;
21+import java.util.Map;
22+
23+import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
24+import jp.sourceforge.tmdmaker.model.DataTypeDeclaration;
25+import jp.sourceforge.tmdmaker.model.Diagram;
26+import jp.sourceforge.tmdmaker.model.IAttribute;
27+import jp.sourceforge.tmdmaker.model.IdentifierRef;
28+import jp.sourceforge.tmdmaker.model.KeyModel;
29+import jp.sourceforge.tmdmaker.model.ModelElement;
30+import jp.sourceforge.tmdmaker.model.ReusedIdentifier;
31+import jp.sourceforge.tmdmaker.model.SarogateKeyRef;
32+import jp.sourceforge.tmdmaker.model.StandardSQLDataType;
33+import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
34+
35+import org.apache.ddlutils.model.Column;
36+import org.apache.ddlutils.model.Database;
37+import org.apache.ddlutils.model.Index;
38+import org.apache.ddlutils.model.IndexColumn;
39+import org.apache.ddlutils.model.NonUniqueIndex;
40+import org.apache.ddlutils.model.Reference;
41+import org.apache.ddlutils.model.Table;
42+import org.apache.ddlutils.model.UniqueIndex;
43+import org.slf4j.Logger;
44+import org.slf4j.LoggerFactory;
45+
46+/**
47+ * TMのモデルをDdlUtilsのモデルへ変換するクラス
48+ *
49+ * @author nakaG
50+ *
51+ */
52+public class DdlUtilsConverter {
53+ /** logging */
54+ private static Logger logger = LoggerFactory
55+ .getLogger(DdlUtilsConverter.class);
56+
57+ /** 外部キーのテーブル */
58+ private List<ForeignConstraints> foreignConstraintsList;
59+
60+ /** 外部キーを出力するか */
61+ private boolean foreignKeyEnabled;
62+
63+ /**
64+ * コンストラクタ
65+ */
66+ public DdlUtilsConverter() {
67+ this(false);
68+ }
69+
70+ /**
71+ * コンストラクタ
72+ *
73+ * @param foreignKeyEnabled
74+ * 外部キーを出力する場合trueを渡す。
75+ */
76+ public DdlUtilsConverter(boolean foreignKeyEnabled) {
77+ this.foreignConstraintsList = new ArrayList<ForeignConstraints>();
78+ this.foreignKeyEnabled = foreignKeyEnabled;
79+ }
80+
81+ /**
82+ * TMD-MakerのモデルをDDLUtilsのデータベースモデルへ変換する
83+ *
84+ * @param diagram
85+ * TMD-Makerのルートモデル
86+ * @return DDLUtilsのルートモデル
87+ */
88+ public Database convert(Diagram diagram, List<AbstractEntityModel> models) {
89+ Database database = createDatabase(diagram);
90+
91+ addModels(database, models);
92+
93+ if (foreignKeyEnabled) {
94+ for (ForeignConstraints foreignConstraints : foreignConstraintsList) {
95+ foreignConstraints.addForeignKeys(database);
96+ }
97+ }
98+ return database;
99+ }
100+
101+ private Database createDatabase(Diagram diagram) {
102+ Database database = new Database();
103+ database.setName(diagram.getName());
104+ return database;
105+ }
106+
107+ private void addModels(Database database, List<AbstractEntityModel> models) {
108+ for (AbstractEntityModel model : models) {
109+ addModel(database, model);
110+ }
111+ }
112+
113+ /**
114+ * TMD-MakerのモデルをDDLUtilsのテーブルモデルとして追加する
115+ *
116+ * @param database
117+ * DDLUtilsのルートモデル
118+ * @param model
119+ * TMD-Makerのモデル
120+ */
121+ private void addModel(Database database, ModelElement model) {
122+ if (!(model instanceof AbstractEntityModel)) {
123+ return;
124+ }
125+ AbstractEntityModel entity = (AbstractEntityModel) model;
126+ if (entity.isNotImplement()) {
127+ return;
128+ }
129+ database.addTable(convert(entity));
130+ }
131+
132+ /**
133+ * TMD-MakerのモデルをDDLUtilsのテーブルモデルへ変換する
134+ *
135+ * @param entity
136+ * TMD-Makerのモデル
137+ * @return DDLUtilsのテーブルモデル
138+ */
139+ private Table convert(AbstractEntityModel entity) {
140+ // テーブル名を指定
141+ Table table = new Table();
142+ table.setName(entity.getImplementName());
143+ table.setDescription(entity.getName());
144+
145+ // 実装対象のアトリビュートをカラムとして追加
146+ Map<IAttribute, Column> attributeColumnMap = new HashMap<IAttribute, Column>();
147+ addColumns(entity, table, attributeColumnMap);
148+
149+ // キーをインデックスとして追加
150+ addIndices(entity, table, attributeColumnMap);
151+
152+ /*
153+ * テーブル名 -> 参照テーブル名 -> リファレンス のリストを作成する。 あとでループして各テーブルで 外部キーを作成して追加する。
154+ */
155+ this.foreignConstraintsList
156+ .add(createForeignConstraints(entity, table));
157+
158+ return table;
159+ }
160+
161+ /**
162+ * カラムを追加する
163+ *
164+ * @param entity
165+ * 対象エンティティ
166+ * @param table
167+ * 対象テーブル
168+ * @param attributeColumnMap
169+ * アトリビュートとカラムのマップ
170+ */
171+ private void addColumns(AbstractEntityModel entity, Table table,
172+ Map<IAttribute, Column> attributeColumnMap) {
173+ List<IAttribute> attributes = ImplementRule
174+ .findAllImplementAttributes(entity);
175+ for (IAttribute a : attributes) {
176+ Column column = convert(a);
177+ table.addColumn(column);
178+ attributeColumnMap.put(a, column);
179+ }
180+ }
181+
182+ /**
183+ * 外部キーテーブルを生成する
184+ *
185+ * @param entity
186+ * 対象モデル
187+ * @param table
188+ * 対象テーブル
189+ */
190+ private ForeignConstraints createForeignConstraints(
191+ AbstractEntityModel entity, Table table) {
192+ System.out.println("createForeignConstraints " + entity.getName() + " "
193+ + table.getName());
194+ ForeignConstraints foreignConstraints = new ForeignConstraints(table);
195+
196+ for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity
197+ .getReusedIdentifieres().entrySet()) {
198+
199+ AbstractEntityModel foreignEntity = reusedMap.getKey();
200+ ReusedIdentifier reused = reusedMap.getValue();
201+
202+ foreignConstraints.addForeignReference(
203+ foreignEntity.getImplementName(), convert(reused),
204+ isRecursive(reused));
205+ }
206+ return foreignConstraints;
207+ }
208+
209+ private Boolean isRecursive(ReusedIdentifier reused) {
210+ // Reused でサロゲートキーが2つあるのは再帰のときのみ。
211+ int count = reused.getSarogateKeys().size();
212+ return (count == 2);
213+ }
214+
215+ /**
216+ *
217+ * Re-Used 列を DdlUtils の Reference のリストに変換する
218+ *
219+ */
220+ private List<Reference> convert(ReusedIdentifier reused) {
221+ List<Reference> refences = new ArrayList<Reference>();
222+
223+ if (reused.isSarogateKeyEnabled()) {
224+ // 再帰表の場合を考慮して1つ目のみを取得
225+ SarogateKeyRef sref = reused.getSarogateKeys().get(0);
226+ Column localColumn = convert(sref);
227+ Column originalColumn = convert(sref.getOriginal());
228+ addReference(refences, localColumn, originalColumn);
229+ return refences;
230+ } else {
231+ int reusedCount = reused.getIdentifires().size();
232+ // 再帰表は同一Reused×2となっているため1つ目のみを取得する
233+ if (isRecursive(reused)) {
234+ reusedCount = reusedCount / 2;
235+ }
236+ List<IdentifierRef> list = reused.getIdentifires();
237+ for (int i = 0; i < reusedCount; i++) {
238+ IdentifierRef iref = list.get(i);
239+ Column localColumn = convert(iref);
240+ Column originalColumn = convert(iref.getOriginal());
241+ addReference(refences, localColumn, originalColumn);
242+ }
243+ return refences;
244+ }
245+ }
246+
247+ private void addReference(List<Reference> refences, Column localColumn,
248+ Column originalColumn) {
249+ Reference reference = new Reference(localColumn, originalColumn);
250+ refences.add(reference);
251+ logger.debug("参照: " + localColumn.getName() + "->"
252+ + originalColumn.getName());
253+ }
254+
255+ /**
256+ * インデックスを追加する
257+ *
258+ * @param entity
259+ * 対象エンティティ
260+ * @param table
261+ * 対象テーブル
262+ * @param attributeColumnMap
263+ * アトリビュートとカラムのマップ
264+ */
265+ private void addIndices(AbstractEntityModel entity, Table table,
266+ Map<IAttribute, Column> attributeColumnMap) {
267+ for (KeyModel idx : entity.getKeyModels()) {
268+
269+ // マスターキーはプライマリキーとして登録する
270+ if (idx.isMasterKey()) {
271+ markPrimaryKeys(table, idx);
272+ } else {
273+ table.addIndex(convert(idx, attributeColumnMap));
274+ }
275+ }
276+ }
277+
278+ /**
279+ * マスターキーのカラムにプライマリキーに設定する
280+ *
281+ * @param table
282+ * 対象テーブル
283+ * @param idx
284+ * マスターキー
285+ */
286+ private void markPrimaryKeys(Table table, KeyModel idx) {
287+ for (IAttribute a : idx.getAttributes()) {
288+ Column c = table.findColumn(a.getImplementName());
289+ if (c != null) {
290+ c.setPrimaryKey(true);
291+ }
292+ }
293+ }
294+
295+ /**
296+ * TMD-MakerのキーモデルをDDLUtilsのインデックスモデルへ変換する
297+ *
298+ * @param key
299+ * TMD-Makerのアトリビュートモデル
300+ * @return DDLUtilsのインデックスモデル
301+ */
302+ private Index convert(KeyModel key,
303+ Map<IAttribute, Column> attributeColumnMap) {
304+ Index index = null;
305+ if (key.isUnique()) {
306+ index = new UniqueIndex();
307+ } else {
308+ index = new NonUniqueIndex();
309+ }
310+ index.setName(key.getName());
311+
312+ for (IAttribute attr : key.getAttributes()) {
313+ Column column = attributeColumnMap.get(attr);
314+ if (column != null) {
315+ IndexColumn indexColumn = new IndexColumn(column);
316+ index.addColumn(indexColumn);
317+ } else {
318+ logger.error("column not found." + attr.getName());
319+ }
320+ }
321+
322+ return index;
323+ }
324+
325+ /**
326+ * TMD-MakerのアトリビュートモデルをDDLUtilsのカラムモデルへ変換する
327+ *
328+ * @param entity
329+ * TMD-Makerのアトリビュートモデル
330+ * @return DDLUtilsのカラムモデル
331+ */
332+ private Column convert(IAttribute attribute) {
333+ Column column = new Column();
334+ column.setName(attribute.getImplementName());
335+ DataTypeDeclaration dtd = attribute.getDataTypeDeclaration();
336+ if (dtd != null) {
337+ StandardSQLDataType dataType = dtd.getLogicalType();
338+ column.setTypeCode(dataType.getSqlType());
339+ if (dataType.isSupportSize() && dtd.getSize() != null) {
340+ column.setSize(dtd.getSize().toString());
341+ }
342+ if (dataType.isSupportScale() && dtd.getScale() != null) {
343+ column.setScale(dtd.getScale().intValue());
344+ }
345+ }
346+ column.setRequired(!attribute.isNullable());
347+ return column;
348+ }
349+
350+ /**
351+ * 全てのテーブルへ共通属性を追加する。
352+ *
353+ * @param database
354+ * 全テーブルを保持するデータベースモデル
355+ * @param commonAttributes
356+ * 共通属性
357+ */
358+ public void addCommonColumns(Database database,
359+ List<IAttribute> commonAttributes) {
360+ if (commonAttributes == null) {
361+ return;
362+ }
363+ for (Table t : database.getTables()) {
364+ addCommonColumns(t, commonAttributes);
365+ }
366+ }
367+
368+ /**
369+ * 共通属性をカラムへ変換してテーブルへ追加する。
370+ *
371+ * @param t
372+ * テーブル
373+ * @param commonAttributes
374+ * 共通属性
375+ */
376+ private void addCommonColumns(Table t, List<IAttribute> commonAttributes) {
377+
378+ for (IAttribute a : commonAttributes) {
379+ t.addColumn(convert(a));
380+ }
381+ }
382+}
--- /dev/null
+++ b/tmdmaker.ddlgenerator/src/jp/sourceforge/tmdmaker/generate/ForeignConstraints.java
@@ -0,0 +1,142 @@
1+package jp.sourceforge.tmdmaker.generate;
2+
3+import java.util.List;
4+import java.util.Map;
5+import java.util.HashMap;
6+
7+import org.apache.ddlutils.model.Database;
8+import org.apache.ddlutils.model.ForeignKey;
9+import org.apache.ddlutils.model.Reference;
10+import org.apache.ddlutils.model.Table;
11+
12+/**
13+ * 外部キー制約
14+ *
15+ * @author tohosaku <ny@cosmichorror.org>
16+ *
17+ */
18+public class ForeignConstraints {
19+
20+ Table table;
21+ Map<String, List<Reference>> foreignReferences;
22+ Map<String, List<Reference>> recursiveForeignReferences;
23+
24+
25+ /**
26+ * コンストラクタ
27+ * @param table
28+ * 制約を課すテーブル
29+ */
30+ public ForeignConstraints(Table table){
31+ this.table = table;
32+ foreignReferences = new HashMap<String, List<Reference>>();
33+ recursiveForeignReferences = new HashMap<String, List<Reference>>();
34+ }
35+
36+
37+ /**
38+ *
39+ * 外部キーの参照先を追加する
40+ *
41+ * @param foreignTableName
42+ * 参照先のテーブル名
43+ * @param references
44+ * 参照するカラム
45+ * @param isRecursive
46+ * 参照元が再帰表かどうか
47+ */
48+ public void addForeignReference(String foreignTableName, List<Reference> references, boolean isRecursive){
49+ System.out.println("addForeignReference() " + foreignTableName + " " + references.size() +" "+ isRecursive);
50+ if (isRecursive) {
51+ addRecursiveForeignReference(foreignTableName, references);
52+ }
53+ else{
54+ addNonRecursiveForeignReference(foreignTableName, references);
55+ }
56+ }
57+
58+ /**
59+ * 外部キーの参照先を追加(制約対象が再帰表ではない場合)
60+ *
61+ * @param tableName
62+ * @param references
63+ */
64+ private void addNonRecursiveForeignReference(String tableName, List<Reference> references){
65+ foreignReferences.put(tableName, references);
66+ }
67+
68+
69+ /**
70+ * 外部キーの参照先を追加(制約対象が再帰表の場合)
71+ *
72+ * @param tableName
73+ * @param references
74+ */
75+ private void addRecursiveForeignReference(String tableName, List<Reference> references){
76+ recursiveForeignReferences.put(tableName, references);
77+ }
78+
79+ /**
80+ * テーブルに外部キー制約をかける
81+ *
82+ * @param database
83+ */
84+ public void addForeignKeys(Database database){
85+
86+ for (Map.Entry<String, List<Reference>> foreignmap
87+ : foreignReferences.entrySet()) {
88+
89+ Table foreignTable = database.findTable(foreignmap.getKey());
90+
91+ if (foreignTable == null){
92+ continue;
93+ }
94+ addForeignKey(foreignTable, foreignmap.getValue());
95+ }
96+
97+ for (Map.Entry<String, List<Reference>> foreignmap
98+ : recursiveForeignReferences.entrySet()) {
99+
100+ Table foreignTable = database.findTable(foreignmap.getKey());
101+
102+ if (foreignTable == null){
103+ continue;
104+ }
105+ addForeignKey(foreignTable, foreignmap.getValue(), 1);
106+ addForeignKey(foreignTable, foreignmap.getValue(), 2);
107+ }
108+ }
109+
110+ /**
111+ * 再帰表以外の外部キー設定
112+ *
113+ * @param foreignTable
114+ * @param references
115+ */
116+ private void addForeignKey(Table foreignTable, List<Reference> references) {
117+ addForeignKey(foreignTable, references, null);
118+ }
119+
120+ /**
121+ * 再帰表の外部キー設定
122+ *
123+ * @param foreignTable
124+ * @param references
125+ * @param no
126+ */
127+ private void addForeignKey(Table foreignTable, List<Reference> references, Integer no) {
128+ String foreignKeyName;
129+ if (no != null) {
130+ foreignKeyName = "FK_" + no.toString() + foreignTable.getName();
131+ } else {
132+ foreignKeyName = "FK_" + foreignTable.getName();
133+ }
134+ ForeignKey foreignKey = new ForeignKey(foreignKeyName);
135+
136+ for (Reference ref : references) {
137+ foreignKey.addReference(ref);
138+ }
139+ foreignKey.setForeignTable(foreignTable);
140+ table.addForeignKey(foreignKey);
141+ }
142+}
--- /dev/null
+++ b/tmdmaker.feature/.project
@@ -0,0 +1,17 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<projectDescription>
3+ <name>tmdmaker.feature</name>
4+ <comment></comment>
5+ <projects>
6+ </projects>
7+ <buildSpec>
8+ <buildCommand>
9+ <name>org.eclipse.pde.FeatureBuilder</name>
10+ <arguments>
11+ </arguments>
12+ </buildCommand>
13+ </buildSpec>
14+ <natures>
15+ <nature>org.eclipse.pde.FeatureNature</nature>
16+ </natures>
17+</projectDescription>
--- /dev/null
+++ b/tmdmaker.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
1+eclipse.preferences.version=1
2+encoding/<project>=UTF-8
--- /dev/null
+++ b/tmdmaker.feature/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
1+eclipse.preferences.version=1
2+line.separator=\n
--- /dev/null
+++ b/tmdmaker.feature/build.properties
@@ -0,0 +1 @@
1+bin.includes = feature.xml
--- /dev/null
+++ b/tmdmaker.feature/feature.xml
@@ -0,0 +1,85 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<feature
3+ id="tmdmaker"
4+ label="TMD-Maker Plug-in"
5+ version="0.2.8.qualifier"
6+ provider-name="TMD-Maker Project"
7+ plugin="tmdmaker">
8+
9+ <description url="http://sourceforge.jp/projects/tmdmaker/">
10+ TMD-Maker Plugin.
11+ </description>
12+
13+ <copyright>
14+ (c) 2009-2014,TMD-Maker Project.
15+ </copyright>
16+
17+ <license url="http://www.apache.org/licenses/LICENSE-2.0">
18+ Apache License Version 2.0
19+ </license>
20+
21+ <requires>
22+ <import plugin="org.eclipse.ui"/>
23+ <import plugin="org.eclipse.gef"/>
24+ <import plugin="org.eclipse.core.runtime"/>
25+ <import plugin="org.eclipse.ui.ide"/>
26+ <import plugin="org.eclipse.core.resources"/>
27+ <import plugin="org.eclipse.ui.views"/>
28+ <import plugin="tmdmaker.imagegenerator" version="0.2.6" match="greaterOrEqual"/>
29+ <import plugin="org.eclipse.draw2d"/>
30+ <import plugin="tmdmaker" version="0.2.5" match="greaterOrEqual"/>
31+ <import plugin="tmdmaker.ddlgenerator" version="0.2.5" match="greaterOrEqual"/>
32+ <import plugin="tmdmaker.htmlgenerator" version="0.2.5" match="greaterOrEqual"/>
33+ <import plugin="org.eclipse.core.expressions"/>
34+ </requires>
35+
36+ <plugin
37+ id="tmdmaker"
38+ download-size="0"
39+ install-size="0"
40+ version="0.0.0"
41+ unpack="false"/>
42+
43+ <plugin
44+ id="tmdmaker.ddlgenerator"
45+ download-size="0"
46+ install-size="0"
47+ version="0.0.0"
48+ unpack="false"/>
49+
50+ <plugin
51+ id="tmdmaker.htmlgenerator"
52+ download-size="0"
53+ install-size="0"
54+ version="0.0.0"
55+ unpack="false"/>
56+
57+ <plugin
58+ id="tmdmaker.imagegenerator"
59+ download-size="0"
60+ install-size="0"
61+ version="0.0.0"
62+ unpack="false"/>
63+
64+ <plugin
65+ id="tmdmaker.serializer"
66+ download-size="0"
67+ install-size="0"
68+ version="0.0.0"
69+ unpack="false"/>
70+
71+ <plugin
72+ id="tmdmaker.serializer.handler.patch0.2.x"
73+ download-size="0"
74+ install-size="0"
75+ version="0.0.0"
76+ unpack="false"/>
77+
78+ <plugin
79+ id="tmdmaker.ui.menu"
80+ download-size="0"
81+ install-size="0"
82+ version="0.0.0"
83+ unpack="false"/>
84+
85+</feature>
--- a/tmdmaker.htmlgenerator/.classpath
+++ b/tmdmaker.htmlgenerator/.classpath
@@ -1,8 +1,8 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <classpath>
3- <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.5.jar"/>
4- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
5- <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.5.jar"/>
3+ <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.6.jar"/>
4+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
5+ <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.6.jar"/>
66 <classpathentry exported="true" kind="lib" path="lib/velocity-1.7.jar"/>
77 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
88 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
--- a/tmdmaker.htmlgenerator/META-INF/MANIFEST.MF
+++ b/tmdmaker.htmlgenerator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker's HTMLGenerator with Velocity
44 Bundle-SymbolicName: tmdmaker.htmlgenerator;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Require-Bundle: org.eclipse.core.runtime,
77 tmdmaker;bundle-version="0.2.0"
88 Bundle-ActivationPolicy: lazy
@@ -15,7 +15,7 @@ Bundle-ClassPath: .,
1515 lib/commons-collections-3.2.1.jar,
1616 lib/commons-lang-2.4.jar,
1717 lib/velocity-1.7.jar,
18- lib/jcl-over-slf4j-1.7.5.jar,
19- lib/slf4j-api-1.7.5.jar,
20- lib/slf4j-simple-1.7.5.jar
18+ lib/jcl-over-slf4j-1.7.6.jar,
19+ lib/slf4j-api-1.7.6.jar,
20+ lib/slf4j-simple-1.7.6.jar
2121 Bundle-Vendor: TMD-Maker Project
Binary files a/tmdmaker/lib/jcl-over-slf4j-1.7.5.jar and b/tmdmaker.htmlgenerator/lib/jcl-over-slf4j-1.7.6.jar differ
Binary files a/tmdmaker.htmlgenerator/lib/slf4j-api-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.htmlgenerator/lib/slf4j-api-1.7.6.jar differ
Binary files a/tmdmaker.htmlgenerator/lib/slf4j-simple-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.htmlgenerator/lib/slf4j-simple-1.7.6.jar differ
--- a/tmdmaker.imagegenerator/META-INF/MANIFEST.MF
+++ b/tmdmaker.imagegenerator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker's ImageGenerator
44 Bundle-SymbolicName: tmdmaker.imagegenerator;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Bundle-Activator: jp.sourceforge.tmdmaker.imagegenerator.Activator
77 Require-Bundle: org.eclipse.ui,
88 org.eclipse.core.runtime,
--- a/tmdmaker.serializer.handler.patch0.2.x/.classpath
+++ b/tmdmaker.serializer.handler.patch0.2.x/.classpath
@@ -1,7 +1,7 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <classpath>
3- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
4- <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.5.jar"/>
3+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
4+ <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.6.jar"/>
55 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
66 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
77 <classpathentry kind="src" path="src"/>
--- a/tmdmaker.serializer.handler.patch0.2.x/META-INF/MANIFEST.MF
+++ b/tmdmaker.serializer.handler.patch0.2.x/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker 0.2.x patch
44 Bundle-SymbolicName: tmdmaker.serializer.handler.patch0.2.x;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Bundle-Activator: jp.sourceforge.tmdmaker.serializer.handler.patch.Activator
77 Require-Bundle: org.eclipse.core.runtime,
88 tmdmaker.serializer
@@ -10,5 +10,5 @@ Bundle-ActivationPolicy: lazy
1010 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
1111 Bundle-Vendor: TMD-Maker Project
1212 Bundle-ClassPath: .,
13- lib/slf4j-api-1.7.5.jar,
14- lib/slf4j-simple-1.7.5.jar
13+ lib/slf4j-api-1.7.6.jar,
14+ lib/slf4j-simple-1.7.6.jar
Binary files a/tmdmaker.serializer.handler.patch0.2.x/lib/slf4j-api-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.serializer.handler.patch0.2.x/lib/slf4j-api-1.7.6.jar differ
Binary files a/tmdmaker.serializer.handler.patch0.2.x/lib/slf4j-simple-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.serializer.handler.patch0.2.x/lib/slf4j-simple-1.7.6.jar differ
--- a/tmdmaker.serializer/.classpath
+++ b/tmdmaker.serializer/.classpath
@@ -1,6 +1,6 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <classpath>
3- <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.4.jar"/>
3+ <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.7.jar"/>
44 <classpathentry exported="true" kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>
55 <classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
66 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
--- a/tmdmaker.serializer/META-INF/MANIFEST.MF
+++ b/tmdmaker.serializer/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker's Serializer with XStream
44 Bundle-SymbolicName: tmdmaker.serializer;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Bundle-Activator: jp.sourceforge.tmdmaker.persistence.Activator
77 Require-Bundle: org.eclipse.core.runtime,
88 tmdmaker;bundle-version="0.2.2";visibility:=reexport
@@ -10,7 +10,7 @@ Bundle-ActivationPolicy: lazy
1010 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
1111 Bundle-ClassPath: lib/xpp3_min-1.1.4c.jar,
1212 lib/xmlpull-1.1.3.1.jar,
13- lib/xstream-1.4.4.jar,
13+ lib/xstream-1.4.7.jar,
1414 .
1515 Export-Package: jp.sourceforge.tmdmaker.persistence.handler
1616 Bundle-Vendor: TMD-Maker Project
Binary files a/tmdmaker.serializer/lib/xstream-1.4.4.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker.serializer/lib/xstream-1.4.7.jar differ
--- a/tmdmaker.ui.menu/META-INF/MANIFEST.MF
+++ b/tmdmaker.ui.menu/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: TMD-Maker Menu
44 Bundle-SymbolicName: tmdmaker.ui.menu; singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Bundle-Activator: jp.sourceforge.tmdmaker.ui.menu.Activator
77 Require-Bundle: org.eclipse.ui,
88 org.eclipse.core.runtime,
--- a/tmdmaker/.classpath
+++ b/tmdmaker/.classpath
@@ -1,8 +1,8 @@
11 <?xml version="1.0" encoding="UTF-8"?>
22 <classpath>
3- <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.5.jar"/>
4- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
5- <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.5.jar"/>
3+ <classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j-1.7.6.jar"/>
4+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
5+ <classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.6.jar"/>
66 <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>
77 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
88 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
--- a/tmdmaker/.settings/org.eclipse.jdt.ui.prefs
+++ b/tmdmaker/.settings/org.eclipse.jdt.ui.prefs
@@ -1,4 +1,3 @@
1-#Fri Jan 06 00:06:21 JST 2012
21 eclipse.preferences.version=1
32 org.eclipse.jdt.ui.javadoc=false
4-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright 2009-2012 TMD-Maker Project &lt;http\://tmdmaker.sourceforge.jp/&gt;\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the "License");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http\://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an "AS IS" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\r\n * {@inheritDoc}\r\n * \r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
3+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright 2009-2014 TMD-Maker Project &lt;http\://tmdmaker.sourceforge.jp/&gt;\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the "License");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http\://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an "AS IS" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\r\n * {@inheritDoc}\r\n * \r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
--- a/tmdmaker/META-INF/MANIFEST.MF
+++ b/tmdmaker/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22 Bundle-ManifestVersion: 2
33 Bundle-Name: %Bundle-Name.0
44 Bundle-SymbolicName: tmdmaker;singleton:=true
5-Bundle-Version: 0.2.7.qualifier
5+Bundle-Version: 0.2.8.qualifier
66 Bundle-Activator: jp.sourceforge.tmdmaker.TMDPlugin
77 Require-Bundle: org.eclipse.ui,
88 org.eclipse.gef,
@@ -15,9 +15,9 @@ Bundle-ActivationPolicy: lazy
1515 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
1616 Bundle-ClassPath: .,
1717 lib/opencsv-2.3.jar,
18- lib/jcl-over-slf4j-1.7.5.jar,
19- lib/slf4j-api-1.7.5.jar,
20- lib/slf4j-simple-1.7.5.jar
18+ lib/jcl-over-slf4j-1.7.6.jar,
19+ lib/slf4j-api-1.7.6.jar,
20+ lib/slf4j-simple-1.7.6.jar
2121 Bundle-Localization: plugin
2222 Bundle-Vendor: %Provider
2323 Export-Package: jp.sourceforge.tmdmaker,
--- /dev/null
+++ b/tmdmaker/about.ini
@@ -0,0 +1,2 @@
1+aboutText=TMD-Maker Plugin
2+featureImage=tmd_icon_32_32bit.png
\ No newline at end of file
--- a/tmdmaker/build.properties
+++ b/tmdmaker/build.properties
@@ -9,6 +9,8 @@ bin.includes = META-INF/,\
99 LICENSE.txt,\
1010 schema/,\
1111 simplelogger.properties,\
12+ about.ini,\
13+ tmd_icon_32_32bit.png,\
1214 lib/
1315 src.includes = lib/,\
1416 icons/
Binary files a/tmdmaker.htmlgenerator/lib/jcl-over-slf4j-1.7.5.jar and b/tmdmaker/lib/jcl-over-slf4j-1.7.6.jar differ
Binary files a/tmdmaker/lib/slf4j-api-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker/lib/slf4j-api-1.7.6.jar differ
Binary files a/tmdmaker/lib/slf4j-simple-1.7.5.jar and /dev/null differ
Binary files /dev/null and b/tmdmaker/lib/slf4j-simple-1.7.6.jar differ
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/editpart/MultivalueAndSupersetEditPart.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/editpart/MultivalueAndSupersetEditPart.java
@@ -74,8 +74,7 @@ public class MultivalueAndSupersetEditPart extends AbstractEntityEditPart {
7474 logger.debug(getClass() + "#updateFigure()");
7575 EntityFigure entityFigure = (EntityFigure) figure;
7676 MultivalueAndSuperset entity = (MultivalueAndSuperset) getModel();
77- entityFigure.setNotImplement(entity.isNotImplement());
78-
77+ entityFigure.setNotImplement(false);
7978 List<IAttribute> atts = entity.getAttributes();
8079 entityFigure.removeAllRelationship();
8180 entityFigure.removeAllAttributes();
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/model/MultivalueAndSuperset.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/model/MultivalueAndSuperset.java
@@ -27,6 +27,14 @@ public class MultivalueAndSuperset extends AbstractEntityModel {
2727 private Detail detail;
2828
2929 /**
30+ * {@inheritDoc}
31+ */
32+ @Override
33+ public boolean isNotImplement() {
34+ return true;
35+ }
36+
37+ /**
3038 *
3139 * {@inheritDoc}
3240 *
@@ -86,5 +94,5 @@ public class MultivalueAndSuperset extends AbstractEntityModel {
8694 copyTo(copy);
8795 return copy;
8896 }
89-
97+
9098 }
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/model/rule/MultivalueRule.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/model/rule/MultivalueRule.java
@@ -47,7 +47,7 @@ public class MultivalueRule {
4747 target.setName(source.getName() + "." + typeName);
4848 target.setEntityType(source.getEntityType());
4949 target.addAttribute(createTypeCode(typeName));
50-
50+ ImplementRule.setModelDefaultValue(target);
5151 return target;
5252 }
5353
@@ -83,7 +83,7 @@ public class MultivalueRule {
8383 detail.setOriginalReusedIdentifier(header.createReusedIdentifier());
8484 detail.getDetailIdentifier().copyFrom(
8585 createDetailIdentifier(header.getName()));
86-
86+ ImplementRule.setModelDefaultValue(detail);
8787 return detail;
8888 }
8989
Binary files /dev/null and b/tmdmaker/tmd_icon_32_32bit.png differ