• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

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


コミットメタ情報

リビジョン6af24e8f3d863fb6596ac7ae15882975d1486933 (tree)
日時2016-03-21 15:15:45
作者nakag <nakag@user...>
コミッターnakag

ログメッセージ

#36186 対応

spell修正。モデルの変更に伴いpatchを用意。

変更サマリ

差分

--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/CombinationTable.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/CombinationTable.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public class CombinationTable extends AbstractEntityModel {
3939 */
4040 @Override
4141 public ReusedIdentifier createReusedIdentifier() {
42- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
42+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
4343 checkDuplicateTargetReusedIdentifieres();
4444 for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres
4545 .entrySet()) {
@@ -55,8 +55,8 @@ public class CombinationTable extends AbstractEntityModel {
5555 }
5656
5757 private Map.Entry<AbstractEntityModel, ReusedIdentifier> getSource() {
58- Iterator<Map.Entry<AbstractEntityModel, ReusedIdentifier>> it = super
59- .getReusedIdentifieres().entrySet().iterator();
58+ Iterator<Map.Entry<AbstractEntityModel, ReusedIdentifier>> it = super.getReusedIdentifieres()
59+ .entrySet().iterator();
6060 if (it.hasNext()) {
6161 return it.next();
6262 }
@@ -64,8 +64,8 @@ public class CombinationTable extends AbstractEntityModel {
6464 }
6565
6666 private Map.Entry<AbstractEntityModel, ReusedIdentifier> getTarget() {
67- Iterator<Map.Entry<AbstractEntityModel, ReusedIdentifier>> it = super
68- .getReusedIdentifieres().entrySet().iterator();
67+ Iterator<Map.Entry<AbstractEntityModel, ReusedIdentifier>> it = super.getReusedIdentifieres()
68+ .entrySet().iterator();
6969
7070 // sourceは読み飛ばす
7171 if (!it.hasNext()) {
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Detail.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Detail.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -99,7 +99,7 @@ public class Detail extends AbstractEntityModel {
9999 */
100100 @Override
101101 public ReusedIdentifier createReusedIdentifier() {
102- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
102+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
103103 returnValue.addAll(this.originalReusedIdentifier.getIdentifires());
104104 returnValue.addIdentifier(detailIdentifier);
105105 return returnValue;
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Entity.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Entity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -101,7 +101,7 @@ public class Entity extends AbstractEntityModel {
101101 */
102102 @Override
103103 public ReusedIdentifier createReusedIdentifier() {
104- return new ReusedIdentifier(this.identifier, keyModels.getSarogateKey());
104+ return new ReusedIdentifier(this.identifier, keyModels.getSurrogateKey());
105105 }
106106
107107 /**
@@ -161,7 +161,7 @@ public class Entity extends AbstractEntityModel {
161161 int i = getIdentifier().getName().length();
162162 return Math.max(super.calcurateMaxIdentifierRefSize(), i);
163163 }
164-
164+
165165 @Override
166166 public void accept(IVisitor visitor) {
167167 visitor.visit(this);
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/KeyModels.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/KeyModels.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ public class KeyModels implements Iterable<KeyModel> {
3131 /** マスターキーとして指定したキーモデル */
3232 private KeyModel masterKey;
3333 /** サロゲートキー */
34- private SarogateKey sarogateKey;
34+ private SurrogateKey surrogateKey;
3535
3636 /**
3737 * @return the masterKey
@@ -144,21 +144,21 @@ public class KeyModels implements Iterable<KeyModel> {
144144 }
145145
146146 /**
147- * @return the sarogateKey
147+ * @return the surrogateKey
148148 */
149- public SarogateKey getSarogateKey() {
150- if (sarogateKey == null) {
151- sarogateKey = new SarogateKey();
149+ public SurrogateKey getSurrogateKey() {
150+ if (surrogateKey == null) {
151+ surrogateKey = new SurrogateKey();
152152 }
153- return sarogateKey;
153+ return surrogateKey;
154154 }
155155
156156 /**
157- * @param sarogateKey
158- * the sarogateKey to set
157+ * @param surrogateKey
158+ * the surrogateKey to set
159159 */
160- protected void setSarogateKey(SarogateKey sarogateKey) {
161- this.sarogateKey = sarogateKey;
160+ protected void setSurrogateKey(SurrogateKey surrogateKey) {
161+ this.surrogateKey = surrogateKey;
162162 }
163163
164164 /**
@@ -169,7 +169,7 @@ public class KeyModels implements Iterable<KeyModel> {
169169 */
170170 public void copyTo(KeyModels to) {
171171 // to.setMasterKey(getMasterKey());
172- to.setSarogateKey(getSarogateKey());
172+ to.setSurrogateKey(getSurrogateKey());
173173 for (KeyModel k : this) {
174174 to.add(k.getCopy());
175175 }
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MappingList.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MappingList.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class MappingList extends AbstractEntityModel {
3333 */
3434 @Override
3535 public ReusedIdentifier createReusedIdentifier() {
36- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
36+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
3737 for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres
3838 .entrySet()) {
3939 returnValue.addAll(rk.getValue().getIdentifires());
@@ -59,8 +59,7 @@ public class MappingList extends AbstractEntityModel {
5959 */
6060 @Override
6161 public boolean isDeletable() {
62- return getModelSourceConnections().size() == 0
63- && getModelTargetConnections().size() == 1;
62+ return getModelSourceConnections().size() == 0 && getModelTargetConnections().size() == 1;
6463 }
6564
6665 /**
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MultivalueOrEntity.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MultivalueOrEntity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public class MultivalueOrEntity extends AbstractEntityModel {
4444 */
4545 @Override
4646 public ReusedIdentifier createReusedIdentifier() {
47- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
47+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
4848 for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres
4949 .entrySet()) {
5050 returnValue.addAll(rk.getValue().getIdentifires());
@@ -59,8 +59,7 @@ public class MultivalueOrEntity extends AbstractEntityModel {
5959 */
6060 @Override
6161 public boolean isDeletable() {
62- return getModelSourceConnections().size() == 0
63- && getModelTargetConnections().size() == 1;
62+ return getModelSourceConnections().size() == 0 && getModelTargetConnections().size() == 1;
6463 }
6564
6665 /**
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/RecursiveTable.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/RecursiveTable.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class RecursiveTable extends AbstractEntityModel {
3333 */
3434 @Override
3535 public ReusedIdentifier createReusedIdentifier() {
36- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
36+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
3737 for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres
3838 .entrySet()) {
3939 returnValue.addAll(rk.getValue().getIdentifires());
@@ -49,7 +49,7 @@ public class RecursiveTable extends AbstractEntityModel {
4949 */
5050 @Override
5151 public void addReusedIdentifier(AbstractEntityModel source) {
52- ReusedIdentifier added = new ReusedIdentifier(keyModels.getSarogateKey());
52+ ReusedIdentifier added = new ReusedIdentifier(keyModels.getSurrogateKey());
5353 added.addAll(source.createReusedIdentifier().getIdentifires());
5454 this.reusedIdentifieres.put(source, added);
5555 firePropertyChange(PROPERTY_REUSED, null, added);
@@ -62,8 +62,8 @@ public class RecursiveTable extends AbstractEntityModel {
6262 * 再帰表の元
6363 */
6464 public void addCreationIdentifier(AbstractEntityModel source) {
65- SarogateKey sarogateKey = source.getKeyModels().getSarogateKey();
66- ReusedIdentifier added = new ReusedIdentifier(sarogateKey, sarogateKey);
65+ SurrogateKey surrogateKey = source.getKeyModels().getSurrogateKey();
66+ ReusedIdentifier added = new ReusedIdentifier(surrogateKey, surrogateKey);
6767 added.addAll(source.createReusedIdentifier().getIdentifires());
6868 added.addAll(source.createReusedIdentifier().getIdentifires());
6969 this.reusedIdentifieres.put(source, added);
@@ -87,8 +87,7 @@ public class RecursiveTable extends AbstractEntityModel {
8787 */
8888 @Override
8989 public boolean isDeletable() {
90- return getModelTargetConnections().size() == 1
91- && getModelSourceConnections().size() == 0;
90+ return getModelTargetConnections().size() == 1 && getModelSourceConnections().size() == 0;
9291 }
9392
9493 /**
@@ -97,8 +96,7 @@ public class RecursiveTable extends AbstractEntityModel {
9796 * @return リレーションシップ元のエンティティ系モデル
9897 */
9998 private AbstractEntityModel getSource() {
100- return (AbstractEntityModel) getModelTargetConnections().get(0)
101- .getSource();
99+ return (AbstractEntityModel) getModelTargetConnections().get(0).getSource();
102100 }
103101
104102 /**
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/ReusedIdentifier.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/ReusedIdentifier.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ public class ReusedIdentifier implements Serializable {
3131 /** 参照元の個体指定子(またはRe-usedキー) */
3232 private List<IdentifierRef> identifieres = new ArrayList<IdentifierRef>();
3333 /** 参照元のサロゲートキー */
34- private List<SarogateKeyRef> sarogateKeys = new ArrayList<SarogateKeyRef>();
34+ private List<SurrogateKeyRef> surrogateKeys = new ArrayList<SurrogateKeyRef>();
3535
3636 /**
3737 * デフォルトコンストラクタ
@@ -44,35 +44,35 @@ public class ReusedIdentifier implements Serializable {
4444 *
4545 * @param identifier
4646 * 参照元の個体指定子
47- * @param sarogateKey
47+ * @param surrogateKey
4848 * 参照元のサロゲートキー
4949 */
50- public ReusedIdentifier(Identifier identifier, SarogateKey sarogateKey) {
50+ public ReusedIdentifier(Identifier identifier, SurrogateKey surrogateKey) {
5151 addIdentifier(identifier);
52- this.sarogateKeys.add(new SarogateKeyRef(sarogateKey));
52+ this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey));
5353 }
5454
5555 /**
5656 * コンストラクタ
5757 *
58- * @param sarogateKey
58+ * @param surrogateKey
5959 * 参照元のサロゲートキー
6060 */
61- public ReusedIdentifier(SarogateKey sarogateKey) {
62- this.sarogateKeys.add(new SarogateKeyRef(sarogateKey));
61+ public ReusedIdentifier(SurrogateKey surrogateKey) {
62+ this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey));
6363 }
6464
6565 /**
6666 * コンストラクタ. 再帰表が作成される時に利用する
6767 *
68- * @param sarogateKey1
68+ * @param surrogateKey1
6969 * 参照元のサロゲートキー
70- * @param sarogateKey2
70+ * @param surrogateKey2
7171 * 参照元のサロゲートキー
7272 */
73- public ReusedIdentifier(SarogateKey sarogateKey1, SarogateKey sarogateKey2) {
74- this.sarogateKeys.add(new SarogateKeyRef(sarogateKey1));
75- this.sarogateKeys.add(new SarogateKeyRef(sarogateKey2));
73+ public ReusedIdentifier(SurrogateKey surrogateKey1, SurrogateKey surrogateKey2) {
74+ this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey1));
75+ this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey2));
7676 }
7777
7878 /**
@@ -85,25 +85,25 @@ public class ReusedIdentifier implements Serializable {
8585 }
8686
8787 /**
88- * 参照元の個体指定子(またはRe-usedキー)を返す。
89- * sourceとtargetで重複する個体指定子は1つにまとめる。
88+ * 参照元の個体指定子(またはRe-usedキー)を返す。 sourceとtargetで重複する個体指定子は1つにまとめる。
89+ *
9090 * @return 重複を排除した参照元の個体指定子(またはRe-usedキー)。
9191 */
9292 public List<IdentifierRef> getUniqueIdentifieres() {
9393 List<IdentifierRef> list = new ArrayList<IdentifierRef>(identifieres.size());
94- for(IdentifierRef i : identifieres) {
94+ for (IdentifierRef i : identifieres) {
9595 if (!i.isDuplicate()) {
9696 list.add(i);
9797 }
9898 }
9999 return Collections.unmodifiableList(list);
100100 }
101-
101+
102102 /**
103- * @return the sarogateKey
103+ * @return the surrogateKeys
104104 */
105- public List<SarogateKeyRef> getSarogateKeys() {
106- return Collections.unmodifiableList(sarogateKeys);
105+ public List<SurrogateKeyRef> getSurrogateKeys() {
106+ return Collections.unmodifiableList(surrogateKeys);
107107 }
108108
109109 /**
@@ -130,10 +130,10 @@ public class ReusedIdentifier implements Serializable {
130130 identifieres.clear();
131131 }
132132
133- public boolean isSarogateKeyEnabled() {
134- if (sarogateKeys != null && sarogateKeys.size() > 0) {
135- SarogateKeyRef sarogateKey = sarogateKeys.get(0);
136- return sarogateKey != null && sarogateKey.isEnabled();
133+ public boolean isSurrogateKeyEnabled() {
134+ if (surrogateKeys != null && surrogateKeys.size() > 0) {
135+ SurrogateKeyRef surrogateKey = surrogateKeys.get(0);
136+ return surrogateKey != null && surrogateKey.isEnabled();
137137 } else {
138138 return false;
139139 }
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SubsetEntity.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SubsetEntity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -51,8 +51,7 @@ public class SubsetEntity extends AbstractEntityModel {
5151 */
5252 @Override
5353 public ReusedIdentifier createReusedIdentifier() {
54- ReusedIdentifier returnValue = new ReusedIdentifier(
55- keyModels.getSarogateKey());
54+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
5655 returnValue.addAll(this.originalReusedIdentifier.getIdentifires());
5756
5857 return returnValue;
@@ -75,8 +74,7 @@ public class SubsetEntity extends AbstractEntityModel {
7574 */
7675 @Override
7776 public boolean isDeletable() {
78- return getModelTargetConnections().size() == 1
79- && getModelSourceConnections().size() == 0;
77+ return getModelTargetConnections().size() == 1 && getModelSourceConnections().size() == 0;
8078 }
8179
8280 /**
@@ -124,10 +122,8 @@ public class SubsetEntity extends AbstractEntityModel {
124122 * @return 派生元モデル(スーパーセット)
125123 */
126124 public AbstractEntityModel getSuperset() {
127- SubsetType type = (SubsetType) getModelTargetConnections().get(0)
128- .getSource();
129- return (AbstractEntityModel) type.getModelTargetConnections().get(0)
130- .getSource();
125+ SubsetType type = (SubsetType) getModelTargetConnections().get(0).getSource();
126+ return (AbstractEntityModel) type.getModelTargetConnections().get(0).getSource();
131127 }
132128
133129 @Override
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SarogateKey.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SurrogateKey.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -22,13 +22,13 @@ package jp.sourceforge.tmdmaker.model;
2222 *
2323 */
2424 @SuppressWarnings("serial")
25-public class SarogateKey extends Attribute {
25+public class SurrogateKey extends Attribute {
2626 private boolean enabled;
2727
2828 /**
2929 * デフォルトコンストラクタ
3030 */
31- public SarogateKey() {
31+ public SurrogateKey() {
3232 setName("");
3333 }
3434
@@ -54,7 +54,7 @@ public class SarogateKey extends Attribute {
5454 */
5555 @Override
5656 public void copyTo(IAttribute to) {
57- SarogateKey to1 = (SarogateKey) to;
57+ SurrogateKey to1 = (SurrogateKey) to;
5858 to1.setDerivationRule(getDerivationRule());
5959 to1.setDescription(getDescription());
6060 to1.setLock(getLock());
@@ -78,7 +78,7 @@ public class SarogateKey extends Attribute {
7878 */
7979 @Override
8080 public IAttribute getCopy() {
81- SarogateKey copy = new SarogateKey();
81+ SurrogateKey copy = new SurrogateKey();
8282 copyTo(copy);
8383 return copy;
8484 }
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SarogateKeyRef.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/SurrogateKeyRef.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@ package jp.sourceforge.tmdmaker.model;
2222 *
2323 */
2424 @SuppressWarnings("serial")
25-public class SarogateKeyRef extends SarogateKey {
26- private SarogateKey original;
25+public class SurrogateKeyRef extends SurrogateKey {
26+ private SurrogateKey original;
2727
2828 /**
2929 * コンストラクタ
@@ -31,7 +31,7 @@ public class SarogateKeyRef extends SarogateKey {
3131 * @param original
3232 * 参照元のサロゲートキー
3333 */
34- public SarogateKeyRef(SarogateKey original) {
34+ public SurrogateKeyRef(SurrogateKey original) {
3535 this.original = original;
3636 }
3737
@@ -48,6 +48,7 @@ public class SarogateKeyRef extends SarogateKey {
4848 }
4949 return returnName;
5050 }
51+
5152 /**
5253 * {@inheritDoc}
5354 *
@@ -57,7 +58,7 @@ public class SarogateKeyRef extends SarogateKey {
5758 public void setImplementName(String implementName) {
5859 String oldValue = super.getImplementName();
5960 if (implementName == null || !implementName.equals(oldValue)) {
60- super.setImplementName(implementName);
61+ super.setImplementName(implementName);
6162 }
6263 }
6364
@@ -78,7 +79,7 @@ public class SarogateKeyRef extends SarogateKey {
7879 /**
7980 * @return the original
8081 */
81- public SarogateKey getOriginal() {
82+ public SurrogateKey getOriginal() {
8283 return original;
8384 }
8485
@@ -86,17 +87,18 @@ public class SarogateKeyRef extends SarogateKey {
8687 * @param original
8788 * the original to set
8889 */
89- public void setOriginal(SarogateKey original) {
90+ public void setOriginal(SurrogateKey original) {
9091 this.original = original;
9192 }
9293
9394 /**
9495 * @return
95- * @see jp.sourceforge.tmdmaker.model.SarogateKey#isEnabled()
96+ * @see jp.sourceforge.tmdmaker.model.SurrogateKey#isEnabled()
9697 */
9798 public boolean isEnabled() {
9899 return original.isEnabled();
99100 }
101+
100102 /**
101103 * {@inheritDoc}
102104 *
@@ -110,6 +112,7 @@ public class SarogateKeyRef extends SarogateKey {
110112 }
111113 return returnValue;
112114 }
115+
113116 /**
114117 * {@inheritDoc}
115118 *
@@ -128,7 +131,7 @@ public class SarogateKeyRef extends SarogateKey {
128131 }
129132 to.setImplementName(getImplementName());
130133 to.setNullable(isNullable());
131-// to.setName(getName());
134+ // to.setName(getName());
132135
133136 }
134137
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/VirtualEntity.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/VirtualEntity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public class VirtualEntity extends AbstractEntityModel {
7878 */
7979 @Override
8080 public ReusedIdentifier createReusedIdentifier() {
81- ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey());
81+ ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey());
8282 returnValue.addAll(this.originalReusedIdentifier.getIdentifires());
8383
8484 return returnValue;
--- a/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/rule/ImplementRule.java
+++ b/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/rule/ImplementRule.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2013 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ import jp.sourceforge.tmdmaker.model.IAttribute;
3131 import jp.sourceforge.tmdmaker.model.Identifier;
3232 import jp.sourceforge.tmdmaker.model.IdentifierRef;
3333 import jp.sourceforge.tmdmaker.model.ReusedIdentifier;
34-import jp.sourceforge.tmdmaker.model.SarogateKey;
35-import jp.sourceforge.tmdmaker.model.SarogateKeyRef;
34+import jp.sourceforge.tmdmaker.model.SurrogateKey;
35+import jp.sourceforge.tmdmaker.model.SurrogateKeyRef;
3636 import jp.sourceforge.tmdmaker.model.StandardSQLDataType;
3737 import jp.sourceforge.tmdmaker.model.SubsetEntity;
3838 import jp.sourceforge.tmdmaker.model.SubsetType;
@@ -55,8 +55,7 @@ public class ImplementRule {
5555 * 派生元
5656 * @return 実装しない派生モデルのリスト。対象が存在しない場合は空リストを返す。
5757 */
58- public static List<AbstractEntityModel> findNotImplementModel(
59- AbstractEntityModel model) {
58+ public static List<AbstractEntityModel> findNotImplementModel(AbstractEntityModel model) {
6059 List<AbstractEntityModel> subsets = new ArrayList<AbstractEntityModel>();
6160 List<AbstractEntityModel> ves = new ArrayList<AbstractEntityModel>();
6261 List<AbstractEntityModel> results = new ArrayList<AbstractEntityModel>();
@@ -76,15 +75,14 @@ public class ImplementRule {
7675 return results;
7776 }
7877
79- private static void findNotImplementSubset(
80- List<AbstractEntityModel> results, AbstractEntityModel model) {
78+ private static void findNotImplementSubset(List<AbstractEntityModel> results,
79+ AbstractEntityModel model) {
8180 SubsetType type = model.findSubsetType();
8281 if (type == null) {
8382 return;
8483 }
8584
86- for (AbstractConnectionModel connection : type
87- .getModelSourceConnections()) {
85+ for (AbstractConnectionModel connection : type.getModelSourceConnections()) {
8886 SubsetEntity subset = (SubsetEntity) connection.getTarget();
8987 if (subset.isNotImplement()) {
9088 results.add(subset);
@@ -93,10 +91,9 @@ public class ImplementRule {
9391 }
9492 }
9593
96- private static void findNotImplementVirtualEntity(
97- List<AbstractEntityModel> results, AbstractEntityModel model) {
98- for (AbstractConnectionModel connection : model
99- .getModelSourceConnections()) {
94+ private static void findNotImplementVirtualEntity(List<AbstractEntityModel> results,
95+ AbstractEntityModel model) {
96+ for (AbstractConnectionModel connection : model.getModelSourceConnections()) {
10097 ConnectableElement e = connection.getTarget();
10198 if (e instanceof VirtualEntity) {
10299 VirtualEntity ve = (VirtualEntity) e;
@@ -115,12 +112,11 @@ public class ImplementRule {
115112 * 対象モデル
116113 * @return アトリビュートのリスト
117114 */
118- public static List<IAttribute> findAllImplementAttributes(
119- AbstractEntityModel model) {
115+ public static List<IAttribute> findAllImplementAttributes(AbstractEntityModel model) {
120116 List<IAttribute> attributes = new ArrayList<IAttribute>();
121- SarogateKey sarogateKey = model.getKeyModels().getSarogateKey();
122- if (sarogateKey.isEnabled()) {
123- attributes.add(sarogateKey);
117+ SurrogateKey surrogateKey = model.getKeyModels().getSurrogateKey();
118+ if (surrogateKey.isEnabled()) {
119+ attributes.add(surrogateKey);
124120 }
125121 // 個体指定子を追加
126122 if (model instanceof Entity) {
@@ -130,23 +126,20 @@ public class ImplementRule {
130126 attributes.add(((Detail) model).getDetailIdentifier());
131127 }
132128 if (model instanceof SubsetEntity) {
133- ReusedIdentifier reused = ((SubsetEntity) model)
134- .getOriginalReusedIdentifier();
129+ ReusedIdentifier reused = ((SubsetEntity) model).getOriginalReusedIdentifier();
135130 for (IdentifierRef ref : reused.getUniqueIdentifieres()) {
136131 attributes.add(ref);
137132 }
138133 }
139134 // re-usedを追加
140- Map<AbstractEntityModel, ReusedIdentifier> reused = model
141- .getReusedIdentifieres();
142- for (Entry<AbstractEntityModel, ReusedIdentifier> entry : reused
143- .entrySet()) {
135+ Map<AbstractEntityModel, ReusedIdentifier> reused = model.getReusedIdentifieres();
136+ for (Entry<AbstractEntityModel, ReusedIdentifier> entry : reused.entrySet()) {
144137 ReusedIdentifier ri = entry.getValue();
145138 if (ri == null) {
146139 continue;
147140 }
148- if (ri.isSarogateKeyEnabled()) {
149- for (SarogateKeyRef s : ri.getSarogateKeys()) {
141+ if (ri.isSurrogateKeyEnabled()) {
142+ for (SurrogateKeyRef s : ri.getSurrogateKeys()) {
150143 attributes.add(s);
151144 }
152145 } else {
@@ -173,15 +166,12 @@ public class ImplementRule {
173166 * 対象モデル(実装対象でないサブセットかみなしエンティティ)
174167 * @return 実装元モデル(候補含む)
175168 */
176- public static AbstractEntityModel findOriginalImplementModel(
177- AbstractEntityModel model) {
169+ public static AbstractEntityModel findOriginalImplementModel(AbstractEntityModel model) {
178170 if (model != null && model.isNotImplement()) {
179171 if (model instanceof SubsetEntity) {
180- return findOriginalImplementModel(((SubsetEntity) model)
181- .getSuperset());
172+ return findOriginalImplementModel(((SubsetEntity) model).getSuperset());
182173 } else if (model instanceof VirtualEntity) {
183- return findOriginalImplementModel(((VirtualEntity) model)
184- .getRealEntity());
174+ return findOriginalImplementModel(((VirtualEntity) model).getRealEntity());
185175 } else {
186176 return model;
187177 }
@@ -213,8 +203,8 @@ public class ImplementRule {
213203 identifier.setImplementName(identifier.getName());
214204 }
215205 if (identifier.getDataTypeDeclaration() == null) {
216- identifier.setDataTypeDeclaration(new DataTypeDeclaration(
217- StandardSQLDataType.NUMERIC, 10, 0));
206+ identifier.setDataTypeDeclaration(
207+ new DataTypeDeclaration(StandardSQLDataType.NUMERIC, 10, 0));
218208 }
219209 }
220210
@@ -226,8 +216,8 @@ public class ImplementRule {
226216 */
227217 public static void setEventDefaultAttributeValue(Attribute attribute) {
228218 attribute.setImplementName(attribute.getName());
229- attribute.setDataTypeDeclaration(new DataTypeDeclaration(
230- StandardSQLDataType.DATE, null, null));
219+ attribute.setDataTypeDeclaration(
220+ new DataTypeDeclaration(StandardSQLDataType.DATE, null, null));
231221
232222 }
233223
@@ -239,8 +229,8 @@ public class ImplementRule {
239229 */
240230 public static void setResourceDefaultAttributeValue(Attribute attribute) {
241231 attribute.setImplementName(attribute.getName());
242- attribute.setDataTypeDeclaration(new DataTypeDeclaration(
243- StandardSQLDataType.CHARACTER_VARYING, 10, null));
232+ attribute.setDataTypeDeclaration(
233+ new DataTypeDeclaration(StandardSQLDataType.CHARACTER_VARYING, 10, null));
244234
245235 }
246236
--- a/tmdmaker.ddlgenerator/src/jp/sourceforge/tmdmaker/generate/DdlUtilsConverter.java
+++ b/tmdmaker.ddlgenerator/src/jp/sourceforge/tmdmaker/generate/DdlUtilsConverter.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ import jp.sourceforge.tmdmaker.model.IdentifierRef;
2929 import jp.sourceforge.tmdmaker.model.KeyModel;
3030 import jp.sourceforge.tmdmaker.model.ModelElement;
3131 import jp.sourceforge.tmdmaker.model.ReusedIdentifier;
32-import jp.sourceforge.tmdmaker.model.SarogateKeyRef;
32+import jp.sourceforge.tmdmaker.model.SurrogateKeyRef;
3333 import jp.sourceforge.tmdmaker.model.StandardSQLDataType;
3434 import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
3535
@@ -53,8 +53,7 @@ import org.slf4j.LoggerFactory;
5353 */
5454 public class DdlUtilsConverter {
5555 /** logging */
56- private static Logger logger = LoggerFactory
57- .getLogger(DdlUtilsConverter.class);
56+ private static Logger logger = LoggerFactory.getLogger(DdlUtilsConverter.class);
5857
5958 /** 外部キーのテーブル */
6059 private List<ForeignConstraints> foreignConstraintsList;
@@ -154,8 +153,7 @@ public class DdlUtilsConverter {
154153 /*
155154 * テーブル名 -> 参照テーブル名 -> リファレンス のリストを作成する。 あとでループして各テーブルで 外部キーを作成して追加する。
156155 */
157- this.foreignConstraintsList
158- .add(createForeignConstraints(entity, table));
156+ this.foreignConstraintsList.add(createForeignConstraints(entity, table));
159157
160158 return table;
161159 }
@@ -170,10 +168,8 @@ public class DdlUtilsConverter {
170168 * @param attributeColumnMap
171169 * アトリビュートとカラムのマップ
172170 */
173- private void addColumns(AbstractEntityModel entity, Table table,
174- Map<IAttribute, Column> attributeColumnMap) {
175- List<IAttribute> attributes = ImplementRule
176- .findAllImplementAttributes(entity);
171+ private void addColumns(AbstractEntityModel entity, Table table, Map<IAttribute, Column> attributeColumnMap) {
172+ List<IAttribute> attributes = ImplementRule.findAllImplementAttributes(entity);
177173 for (IAttribute a : attributes) {
178174 Column column = convert(a);
179175 table.addColumn(column);
@@ -189,20 +185,16 @@ public class DdlUtilsConverter {
189185 * @param table
190186 * 対象テーブル
191187 */
192- private ForeignConstraints createForeignConstraints(
193- AbstractEntityModel entity, Table table) {
194- System.out.println("createForeignConstraints " + entity.getName() + " "
195- + table.getName());
188+ private ForeignConstraints createForeignConstraints(AbstractEntityModel entity, Table table) {
189+ System.out.println("createForeignConstraints " + entity.getName() + " " + table.getName());
196190 ForeignConstraints foreignConstraints = new ForeignConstraints(table);
197191
198- for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity
199- .getReusedIdentifieres().entrySet()) {
192+ for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity.getReusedIdentifieres().entrySet()) {
200193
201194 AbstractEntityModel foreignEntity = reusedMap.getKey();
202195 ReusedIdentifier reused = reusedMap.getValue();
203196
204- foreignConstraints.addForeignReference(
205- foreignEntity.getImplementName(), convert(reused),
197+ foreignConstraints.addForeignReference(foreignEntity.getImplementName(), convert(reused),
206198 isRecursive(reused));
207199 }
208200 return foreignConstraints;
@@ -210,7 +202,7 @@ public class DdlUtilsConverter {
210202
211203 private Boolean isRecursive(ReusedIdentifier reused) {
212204 // Reused でサロゲートキーが2つあるのは再帰のときのみ。
213- int count = reused.getSarogateKeys().size();
205+ int count = reused.getSurrogateKeys().size();
214206 return (count == 2);
215207 }
216208
@@ -222,9 +214,9 @@ public class DdlUtilsConverter {
222214 private List<Reference> convert(ReusedIdentifier reused) {
223215 List<Reference> refences = new ArrayList<Reference>();
224216
225- if (reused.isSarogateKeyEnabled()) {
217+ if (reused.isSurrogateKeyEnabled()) {
226218 // 再帰表の場合を考慮して1つ目のみを取得
227- SarogateKeyRef sref = reused.getSarogateKeys().get(0);
219+ SurrogateKeyRef sref = reused.getSurrogateKeys().get(0);
228220 Column localColumn = convert(sref);
229221 Column originalColumn = convert(sref.getOriginal());
230222 addReference(refences, localColumn, originalColumn);
@@ -247,12 +239,10 @@ public class DdlUtilsConverter {
247239 }
248240 }
249241
250- private void addReference(List<Reference> refences, Column localColumn,
251- Column originalColumn) {
242+ private void addReference(List<Reference> refences, Column localColumn, Column originalColumn) {
252243 Reference reference = new Reference(localColumn, originalColumn);
253244 refences.add(reference);
254- logger.debug("参照: " + localColumn.getName() + "->"
255- + originalColumn.getName());
245+ logger.debug("参照: " + localColumn.getName() + "->" + originalColumn.getName());
256246 }
257247
258248 /**
@@ -265,8 +255,7 @@ public class DdlUtilsConverter {
265255 * @param attributeColumnMap
266256 * アトリビュートとカラムのマップ
267257 */
268- private void addIndices(AbstractEntityModel entity, Table table,
269- Map<IAttribute, Column> attributeColumnMap) {
258+ private void addIndices(AbstractEntityModel entity, Table table, Map<IAttribute, Column> attributeColumnMap) {
270259 for (KeyModel idx : entity.getKeyModels()) {
271260
272261 // マスターキーはプライマリキーとして登録する
@@ -302,8 +291,7 @@ public class DdlUtilsConverter {
302291 * TMD-Makerのアトリビュートモデル
303292 * @return DDLUtilsのインデックスモデル
304293 */
305- private Index convert(KeyModel key,
306- Map<IAttribute, Column> attributeColumnMap) {
294+ private Index convert(KeyModel key, Map<IAttribute, Column> attributeColumnMap) {
307295 Index index = null;
308296 if (key.isUnique()) {
309297 index = new UniqueIndex();
@@ -365,8 +353,7 @@ public class DdlUtilsConverter {
365353 * @param commonAttributes
366354 * 共通属性
367355 */
368- public void addCommonColumns(Database database,
369- List<IAttribute> commonAttributes) {
356+ public void addCommonColumns(Database database, List<IAttribute> commonAttributes) {
370357 if (commonAttributes == null) {
371358 return;
372359 }
--- a/tmdmaker.serializer.handler.patch0.2.x/plugin.xml
+++ b/tmdmaker.serializer.handler.patch0.2.x/plugin.xml
@@ -13,6 +13,9 @@
1313 class="jp.sourceforge.tmdmaker.serializer.handler.patch.Patch026SerializerHandler"
1414 name="Patch026SerializerHandler">
1515 </handler>
16+ <handler
17+ class="jp.sourceforge.tmdmaker.serializer.handler.patch.Patch030SerializerHandler">
18+ </handler>
1619 </extension>
1720
1821 </plugin>
--- a/tmdmaker.serializer.handler.patch0.2.x/src/jp/sourceforge/tmdmaker/serializer/handler/patch/AbstractSerializerHandler.java
+++ b/tmdmaker.serializer.handler.patch0.2.x/src/jp/sourceforge/tmdmaker/serializer/handler/patch/AbstractSerializerHandler.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -15,6 +15,9 @@
1515 */
1616 package jp.sourceforge.tmdmaker.serializer.handler.patch;
1717
18+import java.util.regex.Matcher;
19+import java.util.regex.Pattern;
20+
1821 import org.slf4j.Logger;
1922 import org.slf4j.LoggerFactory;
2023
@@ -22,12 +25,21 @@ import jp.sourceforge.tmdmaker.model.Diagram;
2225 import jp.sourceforge.tmdmaker.model.Version;
2326 import jp.sourceforge.tmdmaker.persistence.handler.SerializerHandler;
2427
28+/**
29+ * Handlerの抽象クラス.
30+ *
31+ * @author nakag
32+ *
33+ */
2534 public class AbstractSerializerHandler implements SerializerHandler {
2635 protected static Logger logger;
2736
37+ /**
38+ * the constructor.
39+ */
2840 public AbstractSerializerHandler() {
2941 logger = LoggerFactory.getLogger(getClass().getName());
30- logger.debug("Patch Start.");
42+ logger.debug("Handler Start.");
3143 }
3244
3345 /**
@@ -88,12 +100,35 @@ public class AbstractSerializerHandler implements SerializerHandler {
88100 * @param serviceNo
89101 * @return 指定以下のバージョンの場合にtrueを返す
90102 */
91- protected boolean versionUnderEqual(Diagram in, int major, int minor,
92- int serviceNo) {
93- Version version = new Version(in.getVersion());
103+ protected boolean versionUnderEqual(Diagram in, int major, int minor, int serviceNo) {
104+ return versionUnderEqualByVersionString(in.getVersion(), major, minor, serviceNo);
105+ }
106+
107+ /**
108+ * モデルのバージョンが指定値以下か判定する
109+ *
110+ * @param in
111+ * モデルのシリアライズ
112+ * @param major
113+ * @param minor
114+ * @param serviceNo
115+ * @return 指定以下のバージョンの場合にtrueを返す
116+ */
117+ protected boolean versionUnderEqual(String in, int major, int minor, int serviceNo) {
118+ Pattern pattern = Pattern.compile("(<version>)(.*?)(</version>)", Pattern.DOTALL);
119+ Matcher matcher = pattern.matcher(in);
120+ if (matcher.find()) {
121+ String versionString = matcher.group(2);
122+ return versionUnderEqualByVersionString(versionString, major, minor, serviceNo);
123+ }
124+ return false;
125+ }
126+
127+ private boolean versionUnderEqualByVersionString(String versionString, int major, int minor, int serviceNo) {
128+ Version version = new Version(versionString);
94129 logger.info("version = " + version.getValue());
95- return version.getMajorVersion() == major
96- && version.getMinorVersion() == minor
130+ return version.getMajorVersion() == major && version.getMinorVersion() == minor
97131 && version.getServiceNo() <= serviceNo;
98132 }
133+
99134 }
\ No newline at end of file
--- /dev/null
+++ b/tmdmaker.serializer.handler.patch0.2.x/src/jp/sourceforge/tmdmaker/serializer/handler/patch/Patch030SerializerHandler.java
@@ -0,0 +1,48 @@
1+/*
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.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.serializer.handler.patch;
17+
18+/**
19+ * モデルのバージョン0.3.0へのバージョンアップ
20+ *
21+ * @author nakaG
22+ *
23+ */
24+public class Patch030SerializerHandler extends AbstractSerializerHandler {
25+
26+ /**
27+ *
28+ * {@inheritDoc}
29+ *
30+ * @see jp.sourceforge.tmdmaker.serializer.handler.patch.AbstractSerializerHandler#handleBeforeDeserialize(java.lang.String)
31+ */
32+ @Override
33+ public String handleBeforeDeserialize(String in) {
34+ logger.info("handleBeforeDeserialize");
35+
36+ if (versionUnderEqual(in, 0, 2, 10)) {
37+ return fixSurrogateKeySpell(in);
38+ }
39+ return in;
40+ }
41+
42+ private String fixSurrogateKeySpell(String in) {
43+ String out1 = in.replace("SarogateKey", "SurrogateKey");
44+ String out2 = out1.replace("sarogateKey", "surrogateKey");
45+ return out2;
46+ }
47+
48+}
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/action/ImplementInfoEditAction.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/action/ImplementInfoEditAction.java
@@ -18,9 +18,9 @@ package jp.sourceforge.tmdmaker.action;
1818 import jp.sourceforge.tmdmaker.Messages;
1919 import jp.sourceforge.tmdmaker.dialog.ImplementInfoEditDialog;
2020 import jp.sourceforge.tmdmaker.dialog.model.EditImplementAttribute;
21-import jp.sourceforge.tmdmaker.dialog.model.EditSarogateKey;
21+import jp.sourceforge.tmdmaker.dialog.model.EditSurrogateKey;
2222 import jp.sourceforge.tmdmaker.model.IAttribute;
23-import jp.sourceforge.tmdmaker.model.SarogateKey;
23+import jp.sourceforge.tmdmaker.model.SurrogateKey;
2424 import jp.sourceforge.tmdmaker.ui.command.AttributeEditCommand;
2525 import jp.sourceforge.tmdmaker.ui.command.ModelEditCommand;
2626
@@ -36,9 +36,12 @@ import org.eclipse.ui.IWorkbenchPart;
3636 */
3737 public class ImplementInfoEditAction extends AbstractEntitySelectionAction {
3838 public static final String ID = "ImplementInfoEditAction"; //$NON-NLS-1$
39+
3940 /**
4041 * コンストラクタ
41- * @param part エディター
42+ *
43+ * @param part
44+ * エディター
4245 */
4346 public ImplementInfoEditAction(IWorkbenchPart part) {
4447 super(part);
@@ -53,35 +56,35 @@ public class ImplementInfoEditAction extends AbstractEntitySelectionAction {
5356 */
5457 @Override
5558 public void run() {
56- ImplementInfoEditDialog dialog = new ImplementInfoEditDialog(getPart()
57- .getViewer().getControl().getShell(), getModel());
59+ ImplementInfoEditDialog dialog = new ImplementInfoEditDialog(
60+ getPart().getViewer().getControl().getShell(), getModel());
5861 if (dialog.open() == Dialog.OK) {
5962
6063 CompoundCommand ccommand = new CompoundCommand();
6164
62- ccommand.add(new ModelEditCommand(getModel(), dialog
63- .getEditedValueEntity()));
64-// for (EditImplementAttribute ei : dialog
65-// .getEditedValueIdentifieres()) {
66-// Identifier newIdentifier = new Identifier();
67-// Identifier original = (Identifier) ei.getOriginalAttribute();
68-// ei.copyTo(newIdentifier);
69-// ccommand.add(new AttributeEditCommand(original, newIdentifier,
70-// ei.getContainerModel()));
71-// }
65+ ccommand.add(new ModelEditCommand(getModel(), dialog.getEditedValueEntity()));
66+ // for (EditImplementAttribute ei : dialog
67+ // .getEditedValueIdentifieres()) {
68+ // Identifier newIdentifier = new Identifier();
69+ // Identifier original = (Identifier) ei.getOriginalAttribute();
70+ // ei.copyTo(newIdentifier);
71+ // ccommand.add(new AttributeEditCommand(original, newIdentifier,
72+ // ei.getContainerModel()));
73+ // }
7274
7375 for (EditImplementAttribute ea : dialog.getEditedValueAttributes()) {
7476 IAttribute original = ea.getOriginalAttribute();
7577 IAttribute newAttribute = original.getCopy();
7678 ea.copyTo(newAttribute);
77- ccommand.add(new AttributeEditCommand(original, newAttribute,
78- ea.getContainerModel()));
79+ ccommand.add(
80+ new AttributeEditCommand(original, newAttribute, ea.getContainerModel()));
7981 }
80- SarogateKey newSarogateKey = new SarogateKey();
81- EditSarogateKey edited = dialog.getEditedSarogateKey();
82- edited.copyTo(newSarogateKey);
83- SarogateKey original = (SarogateKey) edited.getOriginalAttribute();
84- ccommand.add(new AttributeEditCommand(original, newSarogateKey, edited.getContainerModel()));
82+ SurrogateKey newSurrogateKey = new SurrogateKey();
83+ EditSurrogateKey edited = dialog.getEditedSurrogateKey();
84+ edited.copyTo(newSurrogateKey);
85+ SurrogateKey original = (SurrogateKey) edited.getOriginalAttribute();
86+ ccommand.add(new AttributeEditCommand(original, newSurrogateKey,
87+ edited.getContainerModel()));
8588 execute(ccommand);
8689 }
8790 }
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/ImplementInfoEditDialog.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/ImplementInfoEditDialog.java
@@ -26,10 +26,10 @@ import jp.sourceforge.tmdmaker.Messages;
2626 import jp.sourceforge.tmdmaker.dialog.component.ImplementInfoEditPanel;
2727 import jp.sourceforge.tmdmaker.dialog.component.IndexSettingPanel;
2828 import jp.sourceforge.tmdmaker.dialog.component.ModelSelectPanel;
29-import jp.sourceforge.tmdmaker.dialog.component.SarogateKeyPanel;
29+import jp.sourceforge.tmdmaker.dialog.component.SurrogateKeyPanel;
3030 import jp.sourceforge.tmdmaker.dialog.model.EditImplementAttribute;
3131 import jp.sourceforge.tmdmaker.dialog.model.EditImplementEntity;
32-import jp.sourceforge.tmdmaker.dialog.model.EditSarogateKey;
32+import jp.sourceforge.tmdmaker.dialog.model.EditSurrogateKey;
3333 import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
3434 import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
3535
@@ -66,7 +66,7 @@ public class ImplementInfoEditDialog extends Dialog {
6666 private Map<AbstractEntityModel, List<EditImplementAttribute>> otherModelAttributesMap = new HashMap<AbstractEntityModel, List<EditImplementAttribute>>();
6767 private ModelSelectPanel panel2;
6868 private IndexSettingPanel panel3;
69- private SarogateKeyPanel panel4;
69+ private SurrogateKeyPanel panel4;
7070
7171 private Button updateButton;
7272
@@ -166,7 +166,7 @@ public class ImplementInfoEditDialog extends Dialog {
166166 // panel3.initializeValue(editAttributeList, editedKeyModels);
167167 panel3.updateTable();
168168 gridData = new GridData(GridData.FILL_HORIZONTAL);
169- panel4 = new SarogateKeyPanel(composite, SWT.NULL, implementModel);
169+ panel4 = new SurrogateKeyPanel(composite, SWT.NULL, implementModel);
170170 panel4.setLayoutData(gridData);
171171 panel4.refreshVisual();
172172 item2.setControl(composite);
@@ -186,8 +186,6 @@ public class ImplementInfoEditDialog extends Dialog {
186186 editedValueEntity.setImplementName(panel1.getImplementName());
187187 editedValueEntity.setImplementDerivationModels(panel2.getSelectModels());
188188 editedValueEntity.setKeyModels(implementModel.getKeyModels());
189- // implementModel.getSarogateKey();
190- // editedKeyModels.getSarogateKey().copyFrom(e);
191189 createEditAttributeResult();
192190
193191 super.okPressed();
@@ -222,8 +220,8 @@ public class ImplementInfoEditDialog extends Dialog {
222220 return editedValueIdentifieres;
223221 }
224222
225- public EditSarogateKey getEditedSarogateKey() {
226- return implementModel.getSarogateKey();
223+ public EditSurrogateKey getEditedSurrogateKey() {
224+ return implementModel.getSurrogateKey();
227225 }
228226
229227 /**
@@ -243,7 +241,7 @@ public class ImplementInfoEditDialog extends Dialog {
243241 panel1.updateTable();
244242 panel3.updateTable();
245243 panel4.refreshVisual();
246- } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_SAROGATE)) {
244+ } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_SURROGATE)) {
247245 panel3.updateTable();
248246 panel1.updateTable();
249247 } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_KEYMODELS)) {
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/component/SarogateKeyPanel.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/component/SurrogateKeyPanel.java
@@ -33,13 +33,13 @@ import org.eclipse.swt.layout.GridData;
3333 * @author nakag
3434 *
3535 */
36-public class SarogateKeyPanel extends Composite {
36+public class SurrogateKeyPanel extends Composite {
3737 private EditImplementEntity entity;
38- private Button useSarogateKeyCheckBox = null;
38+ private Button useSurrogateKeyCheckBox = null;
3939 private Label nameLabel = null;
4040 private Text inputNameText = null;
4141
42- public SarogateKeyPanel(Composite parent, int style, EditImplementEntity entity) {
42+ public SurrogateKeyPanel(Composite parent, int style, EditImplementEntity entity) {
4343 super(parent, style);
4444 this.entity = entity;
4545 initialize();
@@ -58,12 +58,12 @@ public class SarogateKeyPanel extends Composite {
5858 gridData.horizontalAlignment = SWT.LEFT;
5959 GridLayout gridLayout = new GridLayout();
6060 gridLayout.numColumns = 2;
61- useSarogateKeyCheckBox = new Button(this, SWT.CHECK);
62- useSarogateKeyCheckBox.setText(Messages.AddSurrogateKey);
63- useSarogateKeyCheckBox.setLayoutData(gridData);
64- useSarogateKeyCheckBox.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
61+ useSurrogateKeyCheckBox = new Button(this, SWT.CHECK);
62+ useSurrogateKeyCheckBox.setText(Messages.AddSurrogateKey);
63+ useSurrogateKeyCheckBox.setLayoutData(gridData);
64+ useSurrogateKeyCheckBox.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
6565 public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
66- entity.setSarogateKeyEnabled(useSarogateKeyCheckBox.getSelection());
66+ entity.setSurrogateKeyEnabled(useSurrogateKeyCheckBox.getSelection());
6767 }
6868 });
6969 nameLabel = new Label(this, SWT.NONE);
@@ -72,7 +72,7 @@ public class SarogateKeyPanel extends Composite {
7272 inputNameText.setLayoutData(gridData1);
7373 inputNameText.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
7474 public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
75- entity.setSarogateKeyName(inputNameText.getText());
75+ entity.setSurrogateKeyName(inputNameText.getText());
7676 }
7777 });
7878 this.setLayout(gridLayout);
@@ -80,13 +80,13 @@ public class SarogateKeyPanel extends Composite {
8080 }
8181
8282 public void refreshVisual() {
83- if (entity.isSarogateKeyEnabled()) {
84- useSarogateKeyCheckBox.setSelection(true);
83+ if (entity.isSurrogateKeyEnabled()) {
84+ useSurrogateKeyCheckBox.setSelection(true);
8585 inputNameText.setEnabled(true);
86- inputNameText.setText(entity.getSarogateKeyName());
86+ inputNameText.setText(entity.getSurrogateKeyName());
8787 } else {
88- useSarogateKeyCheckBox.setSelection(false);
89- inputNameText.setText(entity.getSarogateKeyName());
88+ useSurrogateKeyCheckBox.setSelection(false);
89+ inputNameText.setText(entity.getSurrogateKeyName());
9090 inputNameText.setEnabled(false);
9191 }
9292 }
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/model/EditImplementEntity.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/model/EditImplementEntity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ import jp.sourceforge.tmdmaker.model.IdentifierRef;
3131 import jp.sourceforge.tmdmaker.model.KeyModel;
3232 import jp.sourceforge.tmdmaker.model.KeyModels;
3333 import jp.sourceforge.tmdmaker.model.ReusedIdentifier;
34-import jp.sourceforge.tmdmaker.model.SarogateKey;
35-import jp.sourceforge.tmdmaker.model.SarogateKeyRef;
34+import jp.sourceforge.tmdmaker.model.SurrogateKey;
35+import jp.sourceforge.tmdmaker.model.SurrogateKeyRef;
3636 import jp.sourceforge.tmdmaker.model.SubsetEntity;
3737 import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
3838 import jp.sourceforge.tmdmaker.model.util.ModelEditUtils;
@@ -47,14 +47,15 @@ public class EditImplementEntity {
4747 /** プロパティ変更通知用 */
4848 private PropertyChangeSupport listeners = new PropertyChangeSupport(this);
4949 public static final String PROPERTY_ATTRIBUTES = "attributes";
50- public static final String PROPERTY_SAROGATE = "sarogate";
50+ public static final String PROPERTY_SURROGATE = "surrogate";
5151 public static final String PROPERTY_KEYMODELS = "keymodels";
5252 // private AbstractEntityModel model;
53- private EditSarogateKey sarogateKey;
53+ private EditSurrogateKey surrogateKey;
5454 private List<EditImplementAttribute> attributes = new ArrayList<EditImplementAttribute>();
5555 private KeyModels keyModels = new KeyModels();
5656 private Map<AbstractEntityModel, List<EditImplementAttribute>> otherModelAttributesMap = new HashMap<AbstractEntityModel, List<EditImplementAttribute>>();
5757 private String implementName;
58+
5859 /**
5960 * コンストラクタ
6061 *
@@ -68,20 +69,19 @@ public class EditImplementEntity {
6869 if (originalKeyModels != null) {
6970 originalKeyModels.copyTo(keyModels);
7071
71- SarogateKey key = originalKeyModels.getSarogateKey();
72- sarogateKey = new EditSarogateKey(model, key);
73- if (sarogateKey.isEnabled()) {
74- attributes.add(sarogateKey);
72+ SurrogateKey key = originalKeyModels.getSurrogateKey();
73+ surrogateKey = new EditSurrogateKey(model, key);
74+ if (surrogateKey.isEnabled()) {
75+ attributes.add(surrogateKey);
7576 }
7677 }
7778 // 個体指定子をカラムとして追加
7879 if (model instanceof Entity) {
79- attributes.add(new EditImplementAttribute(model, ((Entity) model)
80- .getIdentifier()));
80+ attributes.add(new EditImplementAttribute(model, ((Entity) model).getIdentifier()));
8181 }
8282 if (model instanceof Detail) {
83- attributes.add(new EditImplementAttribute(model, ((Detail) model)
84- .getDetailIdentifier()));
83+ attributes
84+ .add(new EditImplementAttribute(model, ((Detail) model).getDetailIdentifier()));
8585 }
8686 if (model instanceof SubsetEntity) {
8787 ReusedIdentifier reused = ((SubsetEntity) model).getOriginalReusedIdentifier();
@@ -91,19 +91,17 @@ public class EditImplementEntity {
9191
9292 }
9393 // Re-usedをカラムとして追加
94- Map<AbstractEntityModel, ReusedIdentifier> reused = model
95- .getReusedIdentifieres();
96- for (Entry<AbstractEntityModel, ReusedIdentifier> entry : reused
97- .entrySet()) {
94+ Map<AbstractEntityModel, ReusedIdentifier> reused = model.getReusedIdentifieres();
95+ for (Entry<AbstractEntityModel, ReusedIdentifier> entry : reused.entrySet()) {
9896 ReusedIdentifier ri = entry.getValue();
99- if (ri.isSarogateKeyEnabled()) {
97+ if (ri.isSurrogateKeyEnabled()) {
10098 // サロゲートキーをカラムとして使用
101- System.out.println("ri.isSarogateKeyEnabled()");
102- for (SarogateKeyRef s : ri.getSarogateKeys()) {
99+ System.out.println("ri.isSurrogateKeyEnabled()");
100+ for (SurrogateKeyRef s : ri.getSurrogateKeys()) {
103101 attributes.add(new EditImplementAttribute(model, s));
104102 }
105103 } else {
106- System.out.println("not ri.isSarogateKeyEnabled()");
104+ System.out.println("not ri.isSurrogateKeyEnabled()");
107105 // 個体指定子の参照をカラムとして使用
108106 for (IdentifierRef ref : ri.getUniqueIdentifieres()) {
109107 attributes.add(new EditImplementAttribute(model, ref));
@@ -125,8 +123,7 @@ public class EditImplementEntity {
125123 // 対象モデルに戻して実装するモデルが保持するattributeを抽出
126124 if (model.getImplementDerivationModels() != null) {
127125 for (AbstractEntityModel m : model.getImplementDerivationModels()) {
128- List<EditImplementAttribute> list = otherModelAttributesMap
129- .get(m);
126+ List<EditImplementAttribute> list = otherModelAttributesMap.get(m);
130127 if (list != null) {
131128 attributes.addAll(list);
132129 }
@@ -141,14 +138,14 @@ public class EditImplementEntity {
141138 * @param enabled
142139 * サロゲートキーへ設定するプロパティ値
143140 */
144- public void setSarogateKeyEnabled(boolean enabled) {
145- sarogateKey.setEnabled(enabled);
141+ public void setSurrogateKeyEnabled(boolean enabled) {
142+ surrogateKey.setEnabled(enabled);
146143 if (enabled) {
147- addAttribute(0, sarogateKey);
144+ addAttribute(0, surrogateKey);
148145 } else {
149- removeAttribute(sarogateKey);
146+ removeAttribute(surrogateKey);
150147 }
151- firePropertyChange(PROPERTY_ATTRIBUTES, null, sarogateKey);
148+ firePropertyChange(PROPERTY_ATTRIBUTES, null, surrogateKey);
152149 }
153150
154151 /**
@@ -156,8 +153,8 @@ public class EditImplementEntity {
156153 *
157154 * @return サロゲートキーのenabledプロパティ
158155 */
159- public boolean isSarogateKeyEnabled() {
160- return sarogateKey.isEnabled();
156+ public boolean isSurrogateKeyEnabled() {
157+ return surrogateKey.isEnabled();
161158 }
162159
163160 /**
@@ -165,8 +162,8 @@ public class EditImplementEntity {
165162 *
166163 * @return サロゲートキー名
167164 */
168- public String getSarogateKeyName() {
169- return sarogateKey.getName();
165+ public String getSurrogateKeyName() {
166+ return surrogateKey.getName();
170167 }
171168
172169 /**
@@ -175,16 +172,16 @@ public class EditImplementEntity {
175172 * @param name
176173 * サロゲートキー名
177174 */
178- public void setSarogateKeyName(String name) {
179- sarogateKey.setName(name);
180- firePropertyChange(PROPERTY_SAROGATE, null, sarogateKey);
175+ public void setSurrogateKeyName(String name) {
176+ surrogateKey.setName(name);
177+ firePropertyChange(PROPERTY_SURROGATE, null, surrogateKey);
181178 }
182179
183180 /**
184- * @return the sarogateKey
181+ * @return the surrogateKey
185182 */
186- public EditSarogateKey getSarogateKey() {
187- return sarogateKey;
183+ public EditSurrogateKey getSurrogateKey() {
184+ return surrogateKey;
188185 }
189186
190187 /**
@@ -224,8 +221,7 @@ public class EditImplementEntity {
224221 * 削除するアトリビュート
225222 * @return 削除したアトリビュート。アトリビュートが存在しなかった場合はnullを返す。
226223 */
227- public EditImplementAttribute removeAttribute(
228- EditImplementAttribute attribute) {
224+ public EditImplementAttribute removeAttribute(EditImplementAttribute attribute) {
229225 int index = attributes.indexOf(attribute);
230226 if (index >= 0) {
231227 EditImplementAttribute removed = attributes.remove(index);
@@ -340,7 +336,8 @@ public class EditImplementEntity {
340336 }
341337
342338 /**
343- * @param implementName the implementName to set
339+ * @param implementName
340+ * the implementName to set
344341 */
345342 public void setImplementName(String implementName) {
346343 this.implementName = implementName;
@@ -366,8 +363,7 @@ public class EditImplementEntity {
366363 * @param newValue
367364 * 変更後の値
368365 */
369- public void firePropertyChange(String propName, Object oldValue,
370- Object newValue) {
366+ public void firePropertyChange(String propName, Object oldValue, Object newValue) {
371367 listeners.firePropertyChange(propName, oldValue, newValue);
372368 }
373369
--- a/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/model/EditSarogateKey.java
+++ b/tmdmaker/src/jp/sourceforge/tmdmaker/dialog/model/EditSurrogateKey.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2011 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package jp.sourceforge.tmdmaker.dialog.model;
1818 import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
1919 import jp.sourceforge.tmdmaker.model.Attribute;
2020 import jp.sourceforge.tmdmaker.model.IAttribute;
21-import jp.sourceforge.tmdmaker.model.SarogateKey;
21+import jp.sourceforge.tmdmaker.model.SurrogateKey;
2222
2323 /**
2424 * 編集用サロゲートキー
@@ -26,7 +26,7 @@ import jp.sourceforge.tmdmaker.model.SarogateKey;
2626 * @author nakaG
2727 *
2828 */
29-public class EditSarogateKey extends EditImplementAttribute {
29+public class EditSurrogateKey extends EditImplementAttribute {
3030 private boolean enabled;
3131 private boolean added;
3232
@@ -38,8 +38,8 @@ public class EditSarogateKey extends EditImplementAttribute {
3838 * @param original
3939 * サロゲートキー
4040 */
41- public EditSarogateKey(AbstractEntityModel containerModel,
42- SarogateKey original) {
41+ public EditSurrogateKey(AbstractEntityModel containerModel,
42+ SurrogateKey original) {
4343 super(containerModel, original);
4444 if (original == null) {
4545 enabled = false;
@@ -82,7 +82,7 @@ public class EditSarogateKey extends EditImplementAttribute {
8282 */
8383 @Override
8484 public Attribute getOriginalAttribute() {
85- SarogateKey sarogeteKey = (SarogateKey) super.getOriginalAttribute();
85+ SurrogateKey sarogeteKey = (SurrogateKey) super.getOriginalAttribute();
8686 if (added) {
8787 getEditAttribute().copyTo(sarogeteKey);
8888 }
@@ -97,8 +97,8 @@ public class EditSarogateKey extends EditImplementAttribute {
9797 @Override
9898 public void copyTo(IAttribute to) {
9999 super.copyTo(to);
100- if (to instanceof SarogateKey) {
101- ((SarogateKey) to).setEnabled(enabled);
100+ if (to instanceof SurrogateKey) {
101+ ((SurrogateKey) to).setEnabled(enabled);
102102 }
103103 }
104104
@@ -110,7 +110,7 @@ public class EditSarogateKey extends EditImplementAttribute {
110110 @Override
111111 public void copyToOriginal() {
112112 super.copyToOriginal();
113- ((SarogateKey) getOriginalAttribute()).setEnabled(enabled);
113+ ((SurrogateKey) getOriginalAttribute()).setEnabled(enabled);
114114 }
115115
116116 /**
@@ -124,8 +124,8 @@ public class EditSarogateKey extends EditImplementAttribute {
124124 if (this == obj) {
125125 return true;
126126 }
127- if (obj instanceof EditSarogateKey) {
128- EditSarogateKey other = (EditSarogateKey) obj;
127+ if (obj instanceof EditSurrogateKey) {
128+ EditSurrogateKey other = (EditSurrogateKey) obj;
129129 return super.equals(other) &&
130130 getEditAttribute().equals(other.getEditAttribute());
131131 }