TMD-Maker(T字形ER図作成ツール)のEclipse Plugin版
リビジョン | 6af24e8f3d863fb6596ac7ae15882975d1486933 (tree) |
---|---|
日時 | 2016-03-21 15:15:45 |
作者 | nakag <nakag@user...> |
コミッター | nakag |
#36186 対応
spell修正。モデルの変更に伴いpatchを用意。
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -39,7 +39,7 @@ public class CombinationTable extends AbstractEntityModel { | ||
39 | 39 | */ |
40 | 40 | @Override |
41 | 41 | public ReusedIdentifier createReusedIdentifier() { |
42 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
42 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
43 | 43 | checkDuplicateTargetReusedIdentifieres(); |
44 | 44 | for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres |
45 | 45 | .entrySet()) { |
@@ -55,8 +55,8 @@ public class CombinationTable extends AbstractEntityModel { | ||
55 | 55 | } |
56 | 56 | |
57 | 57 | 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(); | |
60 | 60 | if (it.hasNext()) { |
61 | 61 | return it.next(); |
62 | 62 | } |
@@ -64,8 +64,8 @@ public class CombinationTable extends AbstractEntityModel { | ||
64 | 64 | } |
65 | 65 | |
66 | 66 | 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(); | |
69 | 69 | |
70 | 70 | // sourceは読み飛ばす |
71 | 71 | if (!it.hasNext()) { |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -99,7 +99,7 @@ public class Detail extends AbstractEntityModel { | ||
99 | 99 | */ |
100 | 100 | @Override |
101 | 101 | public ReusedIdentifier createReusedIdentifier() { |
102 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
102 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
103 | 103 | returnValue.addAll(this.originalReusedIdentifier.getIdentifires()); |
104 | 104 | returnValue.addIdentifier(detailIdentifier); |
105 | 105 | return returnValue; |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -101,7 +101,7 @@ public class Entity extends AbstractEntityModel { | ||
101 | 101 | */ |
102 | 102 | @Override |
103 | 103 | public ReusedIdentifier createReusedIdentifier() { |
104 | - return new ReusedIdentifier(this.identifier, keyModels.getSarogateKey()); | |
104 | + return new ReusedIdentifier(this.identifier, keyModels.getSurrogateKey()); | |
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -161,7 +161,7 @@ public class Entity extends AbstractEntityModel { | ||
161 | 161 | int i = getIdentifier().getName().length(); |
162 | 162 | return Math.max(super.calcurateMaxIdentifierRefSize(), i); |
163 | 163 | } |
164 | - | |
164 | + | |
165 | 165 | @Override |
166 | 166 | public void accept(IVisitor visitor) { |
167 | 167 | visitor.visit(this); |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -31,7 +31,7 @@ public class KeyModels implements Iterable<KeyModel> { | ||
31 | 31 | /** マスターキーとして指定したキーモデル */ |
32 | 32 | private KeyModel masterKey; |
33 | 33 | /** サロゲートキー */ |
34 | - private SarogateKey sarogateKey; | |
34 | + private SurrogateKey surrogateKey; | |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @return the masterKey |
@@ -144,21 +144,21 @@ public class KeyModels implements Iterable<KeyModel> { | ||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * @return the sarogateKey | |
147 | + * @return the surrogateKey | |
148 | 148 | */ |
149 | - public SarogateKey getSarogateKey() { | |
150 | - if (sarogateKey == null) { | |
151 | - sarogateKey = new SarogateKey(); | |
149 | + public SurrogateKey getSurrogateKey() { | |
150 | + if (surrogateKey == null) { | |
151 | + surrogateKey = new SurrogateKey(); | |
152 | 152 | } |
153 | - return sarogateKey; | |
153 | + return surrogateKey; | |
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * @param sarogateKey | |
158 | - * the sarogateKey to set | |
157 | + * @param surrogateKey | |
158 | + * the surrogateKey to set | |
159 | 159 | */ |
160 | - protected void setSarogateKey(SarogateKey sarogateKey) { | |
161 | - this.sarogateKey = sarogateKey; | |
160 | + protected void setSurrogateKey(SurrogateKey surrogateKey) { | |
161 | + this.surrogateKey = surrogateKey; | |
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -169,7 +169,7 @@ public class KeyModels implements Iterable<KeyModel> { | ||
169 | 169 | */ |
170 | 170 | public void copyTo(KeyModels to) { |
171 | 171 | // to.setMasterKey(getMasterKey()); |
172 | - to.setSarogateKey(getSarogateKey()); | |
172 | + to.setSurrogateKey(getSurrogateKey()); | |
173 | 173 | for (KeyModel k : this) { |
174 | 174 | to.add(k.getCopy()); |
175 | 175 | } |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -33,7 +33,7 @@ public class MappingList extends AbstractEntityModel { | ||
33 | 33 | */ |
34 | 34 | @Override |
35 | 35 | public ReusedIdentifier createReusedIdentifier() { |
36 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
36 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
37 | 37 | for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres |
38 | 38 | .entrySet()) { |
39 | 39 | returnValue.addAll(rk.getValue().getIdentifires()); |
@@ -59,8 +59,7 @@ public class MappingList extends AbstractEntityModel { | ||
59 | 59 | */ |
60 | 60 | @Override |
61 | 61 | public boolean isDeletable() { |
62 | - return getModelSourceConnections().size() == 0 | |
63 | - && getModelTargetConnections().size() == 1; | |
62 | + return getModelSourceConnections().size() == 0 && getModelTargetConnections().size() == 1; | |
64 | 63 | } |
65 | 64 | |
66 | 65 | /** |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -44,7 +44,7 @@ public class MultivalueOrEntity extends AbstractEntityModel { | ||
44 | 44 | */ |
45 | 45 | @Override |
46 | 46 | public ReusedIdentifier createReusedIdentifier() { |
47 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
47 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
48 | 48 | for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres |
49 | 49 | .entrySet()) { |
50 | 50 | returnValue.addAll(rk.getValue().getIdentifires()); |
@@ -59,8 +59,7 @@ public class MultivalueOrEntity extends AbstractEntityModel { | ||
59 | 59 | */ |
60 | 60 | @Override |
61 | 61 | public boolean isDeletable() { |
62 | - return getModelSourceConnections().size() == 0 | |
63 | - && getModelTargetConnections().size() == 1; | |
62 | + return getModelSourceConnections().size() == 0 && getModelTargetConnections().size() == 1; | |
64 | 63 | } |
65 | 64 | |
66 | 65 | /** |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -33,7 +33,7 @@ public class RecursiveTable extends AbstractEntityModel { | ||
33 | 33 | */ |
34 | 34 | @Override |
35 | 35 | public ReusedIdentifier createReusedIdentifier() { |
36 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
36 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
37 | 37 | for (Map.Entry<AbstractEntityModel, ReusedIdentifier> rk : this.reusedIdentifieres |
38 | 38 | .entrySet()) { |
39 | 39 | returnValue.addAll(rk.getValue().getIdentifires()); |
@@ -49,7 +49,7 @@ public class RecursiveTable extends AbstractEntityModel { | ||
49 | 49 | */ |
50 | 50 | @Override |
51 | 51 | public void addReusedIdentifier(AbstractEntityModel source) { |
52 | - ReusedIdentifier added = new ReusedIdentifier(keyModels.getSarogateKey()); | |
52 | + ReusedIdentifier added = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
53 | 53 | added.addAll(source.createReusedIdentifier().getIdentifires()); |
54 | 54 | this.reusedIdentifieres.put(source, added); |
55 | 55 | firePropertyChange(PROPERTY_REUSED, null, added); |
@@ -62,8 +62,8 @@ public class RecursiveTable extends AbstractEntityModel { | ||
62 | 62 | * 再帰表の元 |
63 | 63 | */ |
64 | 64 | 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); | |
67 | 67 | added.addAll(source.createReusedIdentifier().getIdentifires()); |
68 | 68 | added.addAll(source.createReusedIdentifier().getIdentifires()); |
69 | 69 | this.reusedIdentifieres.put(source, added); |
@@ -87,8 +87,7 @@ public class RecursiveTable extends AbstractEntityModel { | ||
87 | 87 | */ |
88 | 88 | @Override |
89 | 89 | public boolean isDeletable() { |
90 | - return getModelTargetConnections().size() == 1 | |
91 | - && getModelSourceConnections().size() == 0; | |
90 | + return getModelTargetConnections().size() == 1 && getModelSourceConnections().size() == 0; | |
92 | 91 | } |
93 | 92 | |
94 | 93 | /** |
@@ -97,8 +96,7 @@ public class RecursiveTable extends AbstractEntityModel { | ||
97 | 96 | * @return リレーションシップ元のエンティティ系モデル |
98 | 97 | */ |
99 | 98 | private AbstractEntityModel getSource() { |
100 | - return (AbstractEntityModel) getModelTargetConnections().get(0) | |
101 | - .getSource(); | |
99 | + return (AbstractEntityModel) getModelTargetConnections().get(0).getSource(); | |
102 | 100 | } |
103 | 101 | |
104 | 102 | /** |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -31,7 +31,7 @@ public class ReusedIdentifier implements Serializable { | ||
31 | 31 | /** 参照元の個体指定子(またはRe-usedキー) */ |
32 | 32 | private List<IdentifierRef> identifieres = new ArrayList<IdentifierRef>(); |
33 | 33 | /** 参照元のサロゲートキー */ |
34 | - private List<SarogateKeyRef> sarogateKeys = new ArrayList<SarogateKeyRef>(); | |
34 | + private List<SurrogateKeyRef> surrogateKeys = new ArrayList<SurrogateKeyRef>(); | |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * デフォルトコンストラクタ |
@@ -44,35 +44,35 @@ public class ReusedIdentifier implements Serializable { | ||
44 | 44 | * |
45 | 45 | * @param identifier |
46 | 46 | * 参照元の個体指定子 |
47 | - * @param sarogateKey | |
47 | + * @param surrogateKey | |
48 | 48 | * 参照元のサロゲートキー |
49 | 49 | */ |
50 | - public ReusedIdentifier(Identifier identifier, SarogateKey sarogateKey) { | |
50 | + public ReusedIdentifier(Identifier identifier, SurrogateKey surrogateKey) { | |
51 | 51 | addIdentifier(identifier); |
52 | - this.sarogateKeys.add(new SarogateKeyRef(sarogateKey)); | |
52 | + this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey)); | |
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * コンストラクタ |
57 | 57 | * |
58 | - * @param sarogateKey | |
58 | + * @param surrogateKey | |
59 | 59 | * 参照元のサロゲートキー |
60 | 60 | */ |
61 | - public ReusedIdentifier(SarogateKey sarogateKey) { | |
62 | - this.sarogateKeys.add(new SarogateKeyRef(sarogateKey)); | |
61 | + public ReusedIdentifier(SurrogateKey surrogateKey) { | |
62 | + this.surrogateKeys.add(new SurrogateKeyRef(surrogateKey)); | |
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | 66 | * コンストラクタ. 再帰表が作成される時に利用する |
67 | 67 | * |
68 | - * @param sarogateKey1 | |
68 | + * @param surrogateKey1 | |
69 | 69 | * 参照元のサロゲートキー |
70 | - * @param sarogateKey2 | |
70 | + * @param surrogateKey2 | |
71 | 71 | * 参照元のサロゲートキー |
72 | 72 | */ |
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)); | |
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -85,25 +85,25 @@ public class ReusedIdentifier implements Serializable { | ||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * 参照元の個体指定子(またはRe-usedキー)を返す。 | |
89 | - * sourceとtargetで重複する個体指定子は1つにまとめる。 | |
88 | + * 参照元の個体指定子(またはRe-usedキー)を返す。 sourceとtargetで重複する個体指定子は1つにまとめる。 | |
89 | + * | |
90 | 90 | * @return 重複を排除した参照元の個体指定子(またはRe-usedキー)。 |
91 | 91 | */ |
92 | 92 | public List<IdentifierRef> getUniqueIdentifieres() { |
93 | 93 | List<IdentifierRef> list = new ArrayList<IdentifierRef>(identifieres.size()); |
94 | - for(IdentifierRef i : identifieres) { | |
94 | + for (IdentifierRef i : identifieres) { | |
95 | 95 | if (!i.isDuplicate()) { |
96 | 96 | list.add(i); |
97 | 97 | } |
98 | 98 | } |
99 | 99 | return Collections.unmodifiableList(list); |
100 | 100 | } |
101 | - | |
101 | + | |
102 | 102 | /** |
103 | - * @return the sarogateKey | |
103 | + * @return the surrogateKeys | |
104 | 104 | */ |
105 | - public List<SarogateKeyRef> getSarogateKeys() { | |
106 | - return Collections.unmodifiableList(sarogateKeys); | |
105 | + public List<SurrogateKeyRef> getSurrogateKeys() { | |
106 | + return Collections.unmodifiableList(surrogateKeys); | |
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -130,10 +130,10 @@ public class ReusedIdentifier implements Serializable { | ||
130 | 130 | identifieres.clear(); |
131 | 131 | } |
132 | 132 | |
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(); | |
137 | 137 | } else { |
138 | 138 | return false; |
139 | 139 | } |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -51,8 +51,7 @@ public class SubsetEntity extends AbstractEntityModel { | ||
51 | 51 | */ |
52 | 52 | @Override |
53 | 53 | public ReusedIdentifier createReusedIdentifier() { |
54 | - ReusedIdentifier returnValue = new ReusedIdentifier( | |
55 | - keyModels.getSarogateKey()); | |
54 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
56 | 55 | returnValue.addAll(this.originalReusedIdentifier.getIdentifires()); |
57 | 56 | |
58 | 57 | return returnValue; |
@@ -75,8 +74,7 @@ public class SubsetEntity extends AbstractEntityModel { | ||
75 | 74 | */ |
76 | 75 | @Override |
77 | 76 | public boolean isDeletable() { |
78 | - return getModelTargetConnections().size() == 1 | |
79 | - && getModelSourceConnections().size() == 0; | |
77 | + return getModelTargetConnections().size() == 1 && getModelSourceConnections().size() == 0; | |
80 | 78 | } |
81 | 79 | |
82 | 80 | /** |
@@ -124,10 +122,8 @@ public class SubsetEntity extends AbstractEntityModel { | ||
124 | 122 | * @return 派生元モデル(スーパーセット) |
125 | 123 | */ |
126 | 124 | 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(); | |
131 | 127 | } |
132 | 128 | |
133 | 129 | @Override |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -22,13 +22,13 @@ package jp.sourceforge.tmdmaker.model; | ||
22 | 22 | * |
23 | 23 | */ |
24 | 24 | @SuppressWarnings("serial") |
25 | -public class SarogateKey extends Attribute { | |
25 | +public class SurrogateKey extends Attribute { | |
26 | 26 | private boolean enabled; |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * デフォルトコンストラクタ |
30 | 30 | */ |
31 | - public SarogateKey() { | |
31 | + public SurrogateKey() { | |
32 | 32 | setName(""); |
33 | 33 | } |
34 | 34 |
@@ -54,7 +54,7 @@ public class SarogateKey extends Attribute { | ||
54 | 54 | */ |
55 | 55 | @Override |
56 | 56 | public void copyTo(IAttribute to) { |
57 | - SarogateKey to1 = (SarogateKey) to; | |
57 | + SurrogateKey to1 = (SurrogateKey) to; | |
58 | 58 | to1.setDerivationRule(getDerivationRule()); |
59 | 59 | to1.setDescription(getDescription()); |
60 | 60 | to1.setLock(getLock()); |
@@ -78,7 +78,7 @@ public class SarogateKey extends Attribute { | ||
78 | 78 | */ |
79 | 79 | @Override |
80 | 80 | public IAttribute getCopy() { |
81 | - SarogateKey copy = new SarogateKey(); | |
81 | + SurrogateKey copy = new SurrogateKey(); | |
82 | 82 | copyTo(copy); |
83 | 83 | return copy; |
84 | 84 | } |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -22,8 +22,8 @@ package jp.sourceforge.tmdmaker.model; | ||
22 | 22 | * |
23 | 23 | */ |
24 | 24 | @SuppressWarnings("serial") |
25 | -public class SarogateKeyRef extends SarogateKey { | |
26 | - private SarogateKey original; | |
25 | +public class SurrogateKeyRef extends SurrogateKey { | |
26 | + private SurrogateKey original; | |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * コンストラクタ |
@@ -31,7 +31,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
31 | 31 | * @param original |
32 | 32 | * 参照元のサロゲートキー |
33 | 33 | */ |
34 | - public SarogateKeyRef(SarogateKey original) { | |
34 | + public SurrogateKeyRef(SurrogateKey original) { | |
35 | 35 | this.original = original; |
36 | 36 | } |
37 | 37 |
@@ -48,6 +48,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
48 | 48 | } |
49 | 49 | return returnName; |
50 | 50 | } |
51 | + | |
51 | 52 | /** |
52 | 53 | * {@inheritDoc} |
53 | 54 | * |
@@ -57,7 +58,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
57 | 58 | public void setImplementName(String implementName) { |
58 | 59 | String oldValue = super.getImplementName(); |
59 | 60 | if (implementName == null || !implementName.equals(oldValue)) { |
60 | - super.setImplementName(implementName); | |
61 | + super.setImplementName(implementName); | |
61 | 62 | } |
62 | 63 | } |
63 | 64 |
@@ -78,7 +79,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
78 | 79 | /** |
79 | 80 | * @return the original |
80 | 81 | */ |
81 | - public SarogateKey getOriginal() { | |
82 | + public SurrogateKey getOriginal() { | |
82 | 83 | return original; |
83 | 84 | } |
84 | 85 |
@@ -86,17 +87,18 @@ public class SarogateKeyRef extends SarogateKey { | ||
86 | 87 | * @param original |
87 | 88 | * the original to set |
88 | 89 | */ |
89 | - public void setOriginal(SarogateKey original) { | |
90 | + public void setOriginal(SurrogateKey original) { | |
90 | 91 | this.original = original; |
91 | 92 | } |
92 | 93 | |
93 | 94 | /** |
94 | 95 | * @return |
95 | - * @see jp.sourceforge.tmdmaker.model.SarogateKey#isEnabled() | |
96 | + * @see jp.sourceforge.tmdmaker.model.SurrogateKey#isEnabled() | |
96 | 97 | */ |
97 | 98 | public boolean isEnabled() { |
98 | 99 | return original.isEnabled(); |
99 | 100 | } |
101 | + | |
100 | 102 | /** |
101 | 103 | * {@inheritDoc} |
102 | 104 | * |
@@ -110,6 +112,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
110 | 112 | } |
111 | 113 | return returnValue; |
112 | 114 | } |
115 | + | |
113 | 116 | /** |
114 | 117 | * {@inheritDoc} |
115 | 118 | * |
@@ -128,7 +131,7 @@ public class SarogateKeyRef extends SarogateKey { | ||
128 | 131 | } |
129 | 132 | to.setImplementName(getImplementName()); |
130 | 133 | to.setNullable(isNullable()); |
131 | -// to.setName(getName()); | |
134 | + // to.setName(getName()); | |
132 | 135 | |
133 | 136 | } |
134 | 137 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -78,7 +78,7 @@ public class VirtualEntity extends AbstractEntityModel { | ||
78 | 78 | */ |
79 | 79 | @Override |
80 | 80 | public ReusedIdentifier createReusedIdentifier() { |
81 | - ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSarogateKey()); | |
81 | + ReusedIdentifier returnValue = new ReusedIdentifier(keyModels.getSurrogateKey()); | |
82 | 82 | returnValue.addAll(this.originalReusedIdentifier.getIdentifires()); |
83 | 83 | |
84 | 84 | return returnValue; |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2013 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -31,8 +31,8 @@ import jp.sourceforge.tmdmaker.model.IAttribute; | ||
31 | 31 | import jp.sourceforge.tmdmaker.model.Identifier; |
32 | 32 | import jp.sourceforge.tmdmaker.model.IdentifierRef; |
33 | 33 | 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; | |
36 | 36 | import jp.sourceforge.tmdmaker.model.StandardSQLDataType; |
37 | 37 | import jp.sourceforge.tmdmaker.model.SubsetEntity; |
38 | 38 | import jp.sourceforge.tmdmaker.model.SubsetType; |
@@ -55,8 +55,7 @@ public class ImplementRule { | ||
55 | 55 | * 派生元 |
56 | 56 | * @return 実装しない派生モデルのリスト。対象が存在しない場合は空リストを返す。 |
57 | 57 | */ |
58 | - public static List<AbstractEntityModel> findNotImplementModel( | |
59 | - AbstractEntityModel model) { | |
58 | + public static List<AbstractEntityModel> findNotImplementModel(AbstractEntityModel model) { | |
60 | 59 | List<AbstractEntityModel> subsets = new ArrayList<AbstractEntityModel>(); |
61 | 60 | List<AbstractEntityModel> ves = new ArrayList<AbstractEntityModel>(); |
62 | 61 | List<AbstractEntityModel> results = new ArrayList<AbstractEntityModel>(); |
@@ -76,15 +75,14 @@ public class ImplementRule { | ||
76 | 75 | return results; |
77 | 76 | } |
78 | 77 | |
79 | - private static void findNotImplementSubset( | |
80 | - List<AbstractEntityModel> results, AbstractEntityModel model) { | |
78 | + private static void findNotImplementSubset(List<AbstractEntityModel> results, | |
79 | + AbstractEntityModel model) { | |
81 | 80 | SubsetType type = model.findSubsetType(); |
82 | 81 | if (type == null) { |
83 | 82 | return; |
84 | 83 | } |
85 | 84 | |
86 | - for (AbstractConnectionModel connection : type | |
87 | - .getModelSourceConnections()) { | |
85 | + for (AbstractConnectionModel connection : type.getModelSourceConnections()) { | |
88 | 86 | SubsetEntity subset = (SubsetEntity) connection.getTarget(); |
89 | 87 | if (subset.isNotImplement()) { |
90 | 88 | results.add(subset); |
@@ -93,10 +91,9 @@ public class ImplementRule { | ||
93 | 91 | } |
94 | 92 | } |
95 | 93 | |
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()) { | |
100 | 97 | ConnectableElement e = connection.getTarget(); |
101 | 98 | if (e instanceof VirtualEntity) { |
102 | 99 | VirtualEntity ve = (VirtualEntity) e; |
@@ -115,12 +112,11 @@ public class ImplementRule { | ||
115 | 112 | * 対象モデル |
116 | 113 | * @return アトリビュートのリスト |
117 | 114 | */ |
118 | - public static List<IAttribute> findAllImplementAttributes( | |
119 | - AbstractEntityModel model) { | |
115 | + public static List<IAttribute> findAllImplementAttributes(AbstractEntityModel model) { | |
120 | 116 | 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); | |
124 | 120 | } |
125 | 121 | // 個体指定子を追加 |
126 | 122 | if (model instanceof Entity) { |
@@ -130,23 +126,20 @@ public class ImplementRule { | ||
130 | 126 | attributes.add(((Detail) model).getDetailIdentifier()); |
131 | 127 | } |
132 | 128 | if (model instanceof SubsetEntity) { |
133 | - ReusedIdentifier reused = ((SubsetEntity) model) | |
134 | - .getOriginalReusedIdentifier(); | |
129 | + ReusedIdentifier reused = ((SubsetEntity) model).getOriginalReusedIdentifier(); | |
135 | 130 | for (IdentifierRef ref : reused.getUniqueIdentifieres()) { |
136 | 131 | attributes.add(ref); |
137 | 132 | } |
138 | 133 | } |
139 | 134 | // 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()) { | |
144 | 137 | ReusedIdentifier ri = entry.getValue(); |
145 | 138 | if (ri == null) { |
146 | 139 | continue; |
147 | 140 | } |
148 | - if (ri.isSarogateKeyEnabled()) { | |
149 | - for (SarogateKeyRef s : ri.getSarogateKeys()) { | |
141 | + if (ri.isSurrogateKeyEnabled()) { | |
142 | + for (SurrogateKeyRef s : ri.getSurrogateKeys()) { | |
150 | 143 | attributes.add(s); |
151 | 144 | } |
152 | 145 | } else { |
@@ -173,15 +166,12 @@ public class ImplementRule { | ||
173 | 166 | * 対象モデル(実装対象でないサブセットかみなしエンティティ) |
174 | 167 | * @return 実装元モデル(候補含む) |
175 | 168 | */ |
176 | - public static AbstractEntityModel findOriginalImplementModel( | |
177 | - AbstractEntityModel model) { | |
169 | + public static AbstractEntityModel findOriginalImplementModel(AbstractEntityModel model) { | |
178 | 170 | if (model != null && model.isNotImplement()) { |
179 | 171 | if (model instanceof SubsetEntity) { |
180 | - return findOriginalImplementModel(((SubsetEntity) model) | |
181 | - .getSuperset()); | |
172 | + return findOriginalImplementModel(((SubsetEntity) model).getSuperset()); | |
182 | 173 | } else if (model instanceof VirtualEntity) { |
183 | - return findOriginalImplementModel(((VirtualEntity) model) | |
184 | - .getRealEntity()); | |
174 | + return findOriginalImplementModel(((VirtualEntity) model).getRealEntity()); | |
185 | 175 | } else { |
186 | 176 | return model; |
187 | 177 | } |
@@ -213,8 +203,8 @@ public class ImplementRule { | ||
213 | 203 | identifier.setImplementName(identifier.getName()); |
214 | 204 | } |
215 | 205 | if (identifier.getDataTypeDeclaration() == null) { |
216 | - identifier.setDataTypeDeclaration(new DataTypeDeclaration( | |
217 | - StandardSQLDataType.NUMERIC, 10, 0)); | |
206 | + identifier.setDataTypeDeclaration( | |
207 | + new DataTypeDeclaration(StandardSQLDataType.NUMERIC, 10, 0)); | |
218 | 208 | } |
219 | 209 | } |
220 | 210 |
@@ -226,8 +216,8 @@ public class ImplementRule { | ||
226 | 216 | */ |
227 | 217 | public static void setEventDefaultAttributeValue(Attribute attribute) { |
228 | 218 | attribute.setImplementName(attribute.getName()); |
229 | - attribute.setDataTypeDeclaration(new DataTypeDeclaration( | |
230 | - StandardSQLDataType.DATE, null, null)); | |
219 | + attribute.setDataTypeDeclaration( | |
220 | + new DataTypeDeclaration(StandardSQLDataType.DATE, null, null)); | |
231 | 221 | |
232 | 222 | } |
233 | 223 |
@@ -239,8 +229,8 @@ public class ImplementRule { | ||
239 | 229 | */ |
240 | 230 | public static void setResourceDefaultAttributeValue(Attribute attribute) { |
241 | 231 | 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)); | |
244 | 234 | |
245 | 235 | } |
246 | 236 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2014 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -29,7 +29,7 @@ import jp.sourceforge.tmdmaker.model.IdentifierRef; | ||
29 | 29 | import jp.sourceforge.tmdmaker.model.KeyModel; |
30 | 30 | import jp.sourceforge.tmdmaker.model.ModelElement; |
31 | 31 | import jp.sourceforge.tmdmaker.model.ReusedIdentifier; |
32 | -import jp.sourceforge.tmdmaker.model.SarogateKeyRef; | |
32 | +import jp.sourceforge.tmdmaker.model.SurrogateKeyRef; | |
33 | 33 | import jp.sourceforge.tmdmaker.model.StandardSQLDataType; |
34 | 34 | import jp.sourceforge.tmdmaker.model.rule.ImplementRule; |
35 | 35 |
@@ -53,8 +53,7 @@ import org.slf4j.LoggerFactory; | ||
53 | 53 | */ |
54 | 54 | public class DdlUtilsConverter { |
55 | 55 | /** logging */ |
56 | - private static Logger logger = LoggerFactory | |
57 | - .getLogger(DdlUtilsConverter.class); | |
56 | + private static Logger logger = LoggerFactory.getLogger(DdlUtilsConverter.class); | |
58 | 57 | |
59 | 58 | /** 外部キーのテーブル */ |
60 | 59 | private List<ForeignConstraints> foreignConstraintsList; |
@@ -154,8 +153,7 @@ public class DdlUtilsConverter { | ||
154 | 153 | /* |
155 | 154 | * テーブル名 -> 参照テーブル名 -> リファレンス のリストを作成する。 あとでループして各テーブルで 外部キーを作成して追加する。 |
156 | 155 | */ |
157 | - this.foreignConstraintsList | |
158 | - .add(createForeignConstraints(entity, table)); | |
156 | + this.foreignConstraintsList.add(createForeignConstraints(entity, table)); | |
159 | 157 | |
160 | 158 | return table; |
161 | 159 | } |
@@ -170,10 +168,8 @@ public class DdlUtilsConverter { | ||
170 | 168 | * @param attributeColumnMap |
171 | 169 | * アトリビュートとカラムのマップ |
172 | 170 | */ |
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); | |
177 | 173 | for (IAttribute a : attributes) { |
178 | 174 | Column column = convert(a); |
179 | 175 | table.addColumn(column); |
@@ -189,20 +185,16 @@ public class DdlUtilsConverter { | ||
189 | 185 | * @param table |
190 | 186 | * 対象テーブル |
191 | 187 | */ |
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()); | |
196 | 190 | ForeignConstraints foreignConstraints = new ForeignConstraints(table); |
197 | 191 | |
198 | - for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity | |
199 | - .getReusedIdentifieres().entrySet()) { | |
192 | + for (Map.Entry<AbstractEntityModel, ReusedIdentifier> reusedMap : entity.getReusedIdentifieres().entrySet()) { | |
200 | 193 | |
201 | 194 | AbstractEntityModel foreignEntity = reusedMap.getKey(); |
202 | 195 | ReusedIdentifier reused = reusedMap.getValue(); |
203 | 196 | |
204 | - foreignConstraints.addForeignReference( | |
205 | - foreignEntity.getImplementName(), convert(reused), | |
197 | + foreignConstraints.addForeignReference(foreignEntity.getImplementName(), convert(reused), | |
206 | 198 | isRecursive(reused)); |
207 | 199 | } |
208 | 200 | return foreignConstraints; |
@@ -210,7 +202,7 @@ public class DdlUtilsConverter { | ||
210 | 202 | |
211 | 203 | private Boolean isRecursive(ReusedIdentifier reused) { |
212 | 204 | // Reused でサロゲートキーが2つあるのは再帰のときのみ。 |
213 | - int count = reused.getSarogateKeys().size(); | |
205 | + int count = reused.getSurrogateKeys().size(); | |
214 | 206 | return (count == 2); |
215 | 207 | } |
216 | 208 |
@@ -222,9 +214,9 @@ public class DdlUtilsConverter { | ||
222 | 214 | private List<Reference> convert(ReusedIdentifier reused) { |
223 | 215 | List<Reference> refences = new ArrayList<Reference>(); |
224 | 216 | |
225 | - if (reused.isSarogateKeyEnabled()) { | |
217 | + if (reused.isSurrogateKeyEnabled()) { | |
226 | 218 | // 再帰表の場合を考慮して1つ目のみを取得 |
227 | - SarogateKeyRef sref = reused.getSarogateKeys().get(0); | |
219 | + SurrogateKeyRef sref = reused.getSurrogateKeys().get(0); | |
228 | 220 | Column localColumn = convert(sref); |
229 | 221 | Column originalColumn = convert(sref.getOriginal()); |
230 | 222 | addReference(refences, localColumn, originalColumn); |
@@ -247,12 +239,10 @@ public class DdlUtilsConverter { | ||
247 | 239 | } |
248 | 240 | } |
249 | 241 | |
250 | - private void addReference(List<Reference> refences, Column localColumn, | |
251 | - Column originalColumn) { | |
242 | + private void addReference(List<Reference> refences, Column localColumn, Column originalColumn) { | |
252 | 243 | Reference reference = new Reference(localColumn, originalColumn); |
253 | 244 | refences.add(reference); |
254 | - logger.debug("参照: " + localColumn.getName() + "->" | |
255 | - + originalColumn.getName()); | |
245 | + logger.debug("参照: " + localColumn.getName() + "->" + originalColumn.getName()); | |
256 | 246 | } |
257 | 247 | |
258 | 248 | /** |
@@ -265,8 +255,7 @@ public class DdlUtilsConverter { | ||
265 | 255 | * @param attributeColumnMap |
266 | 256 | * アトリビュートとカラムのマップ |
267 | 257 | */ |
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) { | |
270 | 259 | for (KeyModel idx : entity.getKeyModels()) { |
271 | 260 | |
272 | 261 | // マスターキーはプライマリキーとして登録する |
@@ -302,8 +291,7 @@ public class DdlUtilsConverter { | ||
302 | 291 | * TMD-Makerのアトリビュートモデル |
303 | 292 | * @return DDLUtilsのインデックスモデル |
304 | 293 | */ |
305 | - private Index convert(KeyModel key, | |
306 | - Map<IAttribute, Column> attributeColumnMap) { | |
294 | + private Index convert(KeyModel key, Map<IAttribute, Column> attributeColumnMap) { | |
307 | 295 | Index index = null; |
308 | 296 | if (key.isUnique()) { |
309 | 297 | index = new UniqueIndex(); |
@@ -365,8 +353,7 @@ public class DdlUtilsConverter { | ||
365 | 353 | * @param commonAttributes |
366 | 354 | * 共通属性 |
367 | 355 | */ |
368 | - public void addCommonColumns(Database database, | |
369 | - List<IAttribute> commonAttributes) { | |
356 | + public void addCommonColumns(Database database, List<IAttribute> commonAttributes) { | |
370 | 357 | if (commonAttributes == null) { |
371 | 358 | return; |
372 | 359 | } |
@@ -13,6 +13,9 @@ | ||
13 | 13 | class="jp.sourceforge.tmdmaker.serializer.handler.patch.Patch026SerializerHandler" |
14 | 14 | name="Patch026SerializerHandler"> |
15 | 15 | </handler> |
16 | + <handler | |
17 | + class="jp.sourceforge.tmdmaker.serializer.handler.patch.Patch030SerializerHandler"> | |
18 | + </handler> | |
16 | 19 | </extension> |
17 | 20 | |
18 | 21 | </plugin> |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2015 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -15,6 +15,9 @@ | ||
15 | 15 | */ |
16 | 16 | package jp.sourceforge.tmdmaker.serializer.handler.patch; |
17 | 17 | |
18 | +import java.util.regex.Matcher; | |
19 | +import java.util.regex.Pattern; | |
20 | + | |
18 | 21 | import org.slf4j.Logger; |
19 | 22 | import org.slf4j.LoggerFactory; |
20 | 23 |
@@ -22,12 +25,21 @@ import jp.sourceforge.tmdmaker.model.Diagram; | ||
22 | 25 | import jp.sourceforge.tmdmaker.model.Version; |
23 | 26 | import jp.sourceforge.tmdmaker.persistence.handler.SerializerHandler; |
24 | 27 | |
28 | +/** | |
29 | + * Handlerの抽象クラス. | |
30 | + * | |
31 | + * @author nakag | |
32 | + * | |
33 | + */ | |
25 | 34 | public class AbstractSerializerHandler implements SerializerHandler { |
26 | 35 | protected static Logger logger; |
27 | 36 | |
37 | + /** | |
38 | + * the constructor. | |
39 | + */ | |
28 | 40 | public AbstractSerializerHandler() { |
29 | 41 | logger = LoggerFactory.getLogger(getClass().getName()); |
30 | - logger.debug("Patch Start."); | |
42 | + logger.debug("Handler Start."); | |
31 | 43 | } |
32 | 44 | |
33 | 45 | /** |
@@ -88,12 +100,35 @@ public class AbstractSerializerHandler implements SerializerHandler { | ||
88 | 100 | * @param serviceNo |
89 | 101 | * @return 指定以下のバージョンの場合にtrueを返す |
90 | 102 | */ |
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); | |
94 | 129 | logger.info("version = " + version.getValue()); |
95 | - return version.getMajorVersion() == major | |
96 | - && version.getMinorVersion() == minor | |
130 | + return version.getMajorVersion() == major && version.getMinorVersion() == minor | |
97 | 131 | && version.getServiceNo() <= serviceNo; |
98 | 132 | } |
133 | + | |
99 | 134 | } |
\ No newline at end of file |
@@ -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 | +} |
@@ -18,9 +18,9 @@ package jp.sourceforge.tmdmaker.action; | ||
18 | 18 | import jp.sourceforge.tmdmaker.Messages; |
19 | 19 | import jp.sourceforge.tmdmaker.dialog.ImplementInfoEditDialog; |
20 | 20 | import jp.sourceforge.tmdmaker.dialog.model.EditImplementAttribute; |
21 | -import jp.sourceforge.tmdmaker.dialog.model.EditSarogateKey; | |
21 | +import jp.sourceforge.tmdmaker.dialog.model.EditSurrogateKey; | |
22 | 22 | import jp.sourceforge.tmdmaker.model.IAttribute; |
23 | -import jp.sourceforge.tmdmaker.model.SarogateKey; | |
23 | +import jp.sourceforge.tmdmaker.model.SurrogateKey; | |
24 | 24 | import jp.sourceforge.tmdmaker.ui.command.AttributeEditCommand; |
25 | 25 | import jp.sourceforge.tmdmaker.ui.command.ModelEditCommand; |
26 | 26 |
@@ -36,9 +36,12 @@ import org.eclipse.ui.IWorkbenchPart; | ||
36 | 36 | */ |
37 | 37 | public class ImplementInfoEditAction extends AbstractEntitySelectionAction { |
38 | 38 | public static final String ID = "ImplementInfoEditAction"; //$NON-NLS-1$ |
39 | + | |
39 | 40 | /** |
40 | 41 | * コンストラクタ |
41 | - * @param part エディター | |
42 | + * | |
43 | + * @param part | |
44 | + * エディター | |
42 | 45 | */ |
43 | 46 | public ImplementInfoEditAction(IWorkbenchPart part) { |
44 | 47 | super(part); |
@@ -53,35 +56,35 @@ public class ImplementInfoEditAction extends AbstractEntitySelectionAction { | ||
53 | 56 | */ |
54 | 57 | @Override |
55 | 58 | 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()); | |
58 | 61 | if (dialog.open() == Dialog.OK) { |
59 | 62 | |
60 | 63 | CompoundCommand ccommand = new CompoundCommand(); |
61 | 64 | |
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 | + // } | |
72 | 74 | |
73 | 75 | for (EditImplementAttribute ea : dialog.getEditedValueAttributes()) { |
74 | 76 | IAttribute original = ea.getOriginalAttribute(); |
75 | 77 | IAttribute newAttribute = original.getCopy(); |
76 | 78 | ea.copyTo(newAttribute); |
77 | - ccommand.add(new AttributeEditCommand(original, newAttribute, | |
78 | - ea.getContainerModel())); | |
79 | + ccommand.add( | |
80 | + new AttributeEditCommand(original, newAttribute, ea.getContainerModel())); | |
79 | 81 | } |
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())); | |
85 | 88 | execute(ccommand); |
86 | 89 | } |
87 | 90 | } |
@@ -26,10 +26,10 @@ import jp.sourceforge.tmdmaker.Messages; | ||
26 | 26 | import jp.sourceforge.tmdmaker.dialog.component.ImplementInfoEditPanel; |
27 | 27 | import jp.sourceforge.tmdmaker.dialog.component.IndexSettingPanel; |
28 | 28 | import jp.sourceforge.tmdmaker.dialog.component.ModelSelectPanel; |
29 | -import jp.sourceforge.tmdmaker.dialog.component.SarogateKeyPanel; | |
29 | +import jp.sourceforge.tmdmaker.dialog.component.SurrogateKeyPanel; | |
30 | 30 | import jp.sourceforge.tmdmaker.dialog.model.EditImplementAttribute; |
31 | 31 | import jp.sourceforge.tmdmaker.dialog.model.EditImplementEntity; |
32 | -import jp.sourceforge.tmdmaker.dialog.model.EditSarogateKey; | |
32 | +import jp.sourceforge.tmdmaker.dialog.model.EditSurrogateKey; | |
33 | 33 | import jp.sourceforge.tmdmaker.model.AbstractEntityModel; |
34 | 34 | import jp.sourceforge.tmdmaker.model.rule.ImplementRule; |
35 | 35 |
@@ -66,7 +66,7 @@ public class ImplementInfoEditDialog extends Dialog { | ||
66 | 66 | private Map<AbstractEntityModel, List<EditImplementAttribute>> otherModelAttributesMap = new HashMap<AbstractEntityModel, List<EditImplementAttribute>>(); |
67 | 67 | private ModelSelectPanel panel2; |
68 | 68 | private IndexSettingPanel panel3; |
69 | - private SarogateKeyPanel panel4; | |
69 | + private SurrogateKeyPanel panel4; | |
70 | 70 | |
71 | 71 | private Button updateButton; |
72 | 72 |
@@ -166,7 +166,7 @@ public class ImplementInfoEditDialog extends Dialog { | ||
166 | 166 | // panel3.initializeValue(editAttributeList, editedKeyModels); |
167 | 167 | panel3.updateTable(); |
168 | 168 | gridData = new GridData(GridData.FILL_HORIZONTAL); |
169 | - panel4 = new SarogateKeyPanel(composite, SWT.NULL, implementModel); | |
169 | + panel4 = new SurrogateKeyPanel(composite, SWT.NULL, implementModel); | |
170 | 170 | panel4.setLayoutData(gridData); |
171 | 171 | panel4.refreshVisual(); |
172 | 172 | item2.setControl(composite); |
@@ -186,8 +186,6 @@ public class ImplementInfoEditDialog extends Dialog { | ||
186 | 186 | editedValueEntity.setImplementName(panel1.getImplementName()); |
187 | 187 | editedValueEntity.setImplementDerivationModels(panel2.getSelectModels()); |
188 | 188 | editedValueEntity.setKeyModels(implementModel.getKeyModels()); |
189 | - // implementModel.getSarogateKey(); | |
190 | - // editedKeyModels.getSarogateKey().copyFrom(e); | |
191 | 189 | createEditAttributeResult(); |
192 | 190 | |
193 | 191 | super.okPressed(); |
@@ -222,8 +220,8 @@ public class ImplementInfoEditDialog extends Dialog { | ||
222 | 220 | return editedValueIdentifieres; |
223 | 221 | } |
224 | 222 | |
225 | - public EditSarogateKey getEditedSarogateKey() { | |
226 | - return implementModel.getSarogateKey(); | |
223 | + public EditSurrogateKey getEditedSurrogateKey() { | |
224 | + return implementModel.getSurrogateKey(); | |
227 | 225 | } |
228 | 226 | |
229 | 227 | /** |
@@ -243,7 +241,7 @@ public class ImplementInfoEditDialog extends Dialog { | ||
243 | 241 | panel1.updateTable(); |
244 | 242 | panel3.updateTable(); |
245 | 243 | panel4.refreshVisual(); |
246 | - } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_SAROGATE)) { | |
244 | + } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_SURROGATE)) { | |
247 | 245 | panel3.updateTable(); |
248 | 246 | panel1.updateTable(); |
249 | 247 | } else if (evt.getPropertyName().equals(EditImplementEntity.PROPERTY_KEYMODELS)) { |
@@ -33,13 +33,13 @@ import org.eclipse.swt.layout.GridData; | ||
33 | 33 | * @author nakag |
34 | 34 | * |
35 | 35 | */ |
36 | -public class SarogateKeyPanel extends Composite { | |
36 | +public class SurrogateKeyPanel extends Composite { | |
37 | 37 | private EditImplementEntity entity; |
38 | - private Button useSarogateKeyCheckBox = null; | |
38 | + private Button useSurrogateKeyCheckBox = null; | |
39 | 39 | private Label nameLabel = null; |
40 | 40 | private Text inputNameText = null; |
41 | 41 | |
42 | - public SarogateKeyPanel(Composite parent, int style, EditImplementEntity entity) { | |
42 | + public SurrogateKeyPanel(Composite parent, int style, EditImplementEntity entity) { | |
43 | 43 | super(parent, style); |
44 | 44 | this.entity = entity; |
45 | 45 | initialize(); |
@@ -58,12 +58,12 @@ public class SarogateKeyPanel extends Composite { | ||
58 | 58 | gridData.horizontalAlignment = SWT.LEFT; |
59 | 59 | GridLayout gridLayout = new GridLayout(); |
60 | 60 | 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() { | |
65 | 65 | public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { |
66 | - entity.setSarogateKeyEnabled(useSarogateKeyCheckBox.getSelection()); | |
66 | + entity.setSurrogateKeyEnabled(useSurrogateKeyCheckBox.getSelection()); | |
67 | 67 | } |
68 | 68 | }); |
69 | 69 | nameLabel = new Label(this, SWT.NONE); |
@@ -72,7 +72,7 @@ public class SarogateKeyPanel extends Composite { | ||
72 | 72 | inputNameText.setLayoutData(gridData1); |
73 | 73 | inputNameText.addModifyListener(new org.eclipse.swt.events.ModifyListener() { |
74 | 74 | public void modifyText(org.eclipse.swt.events.ModifyEvent e) { |
75 | - entity.setSarogateKeyName(inputNameText.getText()); | |
75 | + entity.setSurrogateKeyName(inputNameText.getText()); | |
76 | 76 | } |
77 | 77 | }); |
78 | 78 | this.setLayout(gridLayout); |
@@ -80,13 +80,13 @@ public class SarogateKeyPanel extends Composite { | ||
80 | 80 | } |
81 | 81 | |
82 | 82 | public void refreshVisual() { |
83 | - if (entity.isSarogateKeyEnabled()) { | |
84 | - useSarogateKeyCheckBox.setSelection(true); | |
83 | + if (entity.isSurrogateKeyEnabled()) { | |
84 | + useSurrogateKeyCheckBox.setSelection(true); | |
85 | 85 | inputNameText.setEnabled(true); |
86 | - inputNameText.setText(entity.getSarogateKeyName()); | |
86 | + inputNameText.setText(entity.getSurrogateKeyName()); | |
87 | 87 | } else { |
88 | - useSarogateKeyCheckBox.setSelection(false); | |
89 | - inputNameText.setText(entity.getSarogateKeyName()); | |
88 | + useSurrogateKeyCheckBox.setSelection(false); | |
89 | + inputNameText.setText(entity.getSurrogateKeyName()); | |
90 | 90 | inputNameText.setEnabled(false); |
91 | 91 | } |
92 | 92 | } |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2010 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -31,8 +31,8 @@ import jp.sourceforge.tmdmaker.model.IdentifierRef; | ||
31 | 31 | import jp.sourceforge.tmdmaker.model.KeyModel; |
32 | 32 | import jp.sourceforge.tmdmaker.model.KeyModels; |
33 | 33 | 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; | |
36 | 36 | import jp.sourceforge.tmdmaker.model.SubsetEntity; |
37 | 37 | import jp.sourceforge.tmdmaker.model.rule.ImplementRule; |
38 | 38 | import jp.sourceforge.tmdmaker.model.util.ModelEditUtils; |
@@ -47,14 +47,15 @@ public class EditImplementEntity { | ||
47 | 47 | /** プロパティ変更通知用 */ |
48 | 48 | private PropertyChangeSupport listeners = new PropertyChangeSupport(this); |
49 | 49 | public static final String PROPERTY_ATTRIBUTES = "attributes"; |
50 | - public static final String PROPERTY_SAROGATE = "sarogate"; | |
50 | + public static final String PROPERTY_SURROGATE = "surrogate"; | |
51 | 51 | public static final String PROPERTY_KEYMODELS = "keymodels"; |
52 | 52 | // private AbstractEntityModel model; |
53 | - private EditSarogateKey sarogateKey; | |
53 | + private EditSurrogateKey surrogateKey; | |
54 | 54 | private List<EditImplementAttribute> attributes = new ArrayList<EditImplementAttribute>(); |
55 | 55 | private KeyModels keyModels = new KeyModels(); |
56 | 56 | private Map<AbstractEntityModel, List<EditImplementAttribute>> otherModelAttributesMap = new HashMap<AbstractEntityModel, List<EditImplementAttribute>>(); |
57 | 57 | private String implementName; |
58 | + | |
58 | 59 | /** |
59 | 60 | * コンストラクタ |
60 | 61 | * |
@@ -68,20 +69,19 @@ public class EditImplementEntity { | ||
68 | 69 | if (originalKeyModels != null) { |
69 | 70 | originalKeyModels.copyTo(keyModels); |
70 | 71 | |
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); | |
75 | 76 | } |
76 | 77 | } |
77 | 78 | // 個体指定子をカラムとして追加 |
78 | 79 | if (model instanceof Entity) { |
79 | - attributes.add(new EditImplementAttribute(model, ((Entity) model) | |
80 | - .getIdentifier())); | |
80 | + attributes.add(new EditImplementAttribute(model, ((Entity) model).getIdentifier())); | |
81 | 81 | } |
82 | 82 | if (model instanceof Detail) { |
83 | - attributes.add(new EditImplementAttribute(model, ((Detail) model) | |
84 | - .getDetailIdentifier())); | |
83 | + attributes | |
84 | + .add(new EditImplementAttribute(model, ((Detail) model).getDetailIdentifier())); | |
85 | 85 | } |
86 | 86 | if (model instanceof SubsetEntity) { |
87 | 87 | ReusedIdentifier reused = ((SubsetEntity) model).getOriginalReusedIdentifier(); |
@@ -91,19 +91,17 @@ public class EditImplementEntity { | ||
91 | 91 | |
92 | 92 | } |
93 | 93 | // 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()) { | |
98 | 96 | ReusedIdentifier ri = entry.getValue(); |
99 | - if (ri.isSarogateKeyEnabled()) { | |
97 | + if (ri.isSurrogateKeyEnabled()) { | |
100 | 98 | // サロゲートキーをカラムとして使用 |
101 | - System.out.println("ri.isSarogateKeyEnabled()"); | |
102 | - for (SarogateKeyRef s : ri.getSarogateKeys()) { | |
99 | + System.out.println("ri.isSurrogateKeyEnabled()"); | |
100 | + for (SurrogateKeyRef s : ri.getSurrogateKeys()) { | |
103 | 101 | attributes.add(new EditImplementAttribute(model, s)); |
104 | 102 | } |
105 | 103 | } else { |
106 | - System.out.println("not ri.isSarogateKeyEnabled()"); | |
104 | + System.out.println("not ri.isSurrogateKeyEnabled()"); | |
107 | 105 | // 個体指定子の参照をカラムとして使用 |
108 | 106 | for (IdentifierRef ref : ri.getUniqueIdentifieres()) { |
109 | 107 | attributes.add(new EditImplementAttribute(model, ref)); |
@@ -125,8 +123,7 @@ public class EditImplementEntity { | ||
125 | 123 | // 対象モデルに戻して実装するモデルが保持するattributeを抽出 |
126 | 124 | if (model.getImplementDerivationModels() != null) { |
127 | 125 | for (AbstractEntityModel m : model.getImplementDerivationModels()) { |
128 | - List<EditImplementAttribute> list = otherModelAttributesMap | |
129 | - .get(m); | |
126 | + List<EditImplementAttribute> list = otherModelAttributesMap.get(m); | |
130 | 127 | if (list != null) { |
131 | 128 | attributes.addAll(list); |
132 | 129 | } |
@@ -141,14 +138,14 @@ public class EditImplementEntity { | ||
141 | 138 | * @param enabled |
142 | 139 | * サロゲートキーへ設定するプロパティ値 |
143 | 140 | */ |
144 | - public void setSarogateKeyEnabled(boolean enabled) { | |
145 | - sarogateKey.setEnabled(enabled); | |
141 | + public void setSurrogateKeyEnabled(boolean enabled) { | |
142 | + surrogateKey.setEnabled(enabled); | |
146 | 143 | if (enabled) { |
147 | - addAttribute(0, sarogateKey); | |
144 | + addAttribute(0, surrogateKey); | |
148 | 145 | } else { |
149 | - removeAttribute(sarogateKey); | |
146 | + removeAttribute(surrogateKey); | |
150 | 147 | } |
151 | - firePropertyChange(PROPERTY_ATTRIBUTES, null, sarogateKey); | |
148 | + firePropertyChange(PROPERTY_ATTRIBUTES, null, surrogateKey); | |
152 | 149 | } |
153 | 150 | |
154 | 151 | /** |
@@ -156,8 +153,8 @@ public class EditImplementEntity { | ||
156 | 153 | * |
157 | 154 | * @return サロゲートキーのenabledプロパティ |
158 | 155 | */ |
159 | - public boolean isSarogateKeyEnabled() { | |
160 | - return sarogateKey.isEnabled(); | |
156 | + public boolean isSurrogateKeyEnabled() { | |
157 | + return surrogateKey.isEnabled(); | |
161 | 158 | } |
162 | 159 | |
163 | 160 | /** |
@@ -165,8 +162,8 @@ public class EditImplementEntity { | ||
165 | 162 | * |
166 | 163 | * @return サロゲートキー名 |
167 | 164 | */ |
168 | - public String getSarogateKeyName() { | |
169 | - return sarogateKey.getName(); | |
165 | + public String getSurrogateKeyName() { | |
166 | + return surrogateKey.getName(); | |
170 | 167 | } |
171 | 168 | |
172 | 169 | /** |
@@ -175,16 +172,16 @@ public class EditImplementEntity { | ||
175 | 172 | * @param name |
176 | 173 | * サロゲートキー名 |
177 | 174 | */ |
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); | |
181 | 178 | } |
182 | 179 | |
183 | 180 | /** |
184 | - * @return the sarogateKey | |
181 | + * @return the surrogateKey | |
185 | 182 | */ |
186 | - public EditSarogateKey getSarogateKey() { | |
187 | - return sarogateKey; | |
183 | + public EditSurrogateKey getSurrogateKey() { | |
184 | + return surrogateKey; | |
188 | 185 | } |
189 | 186 | |
190 | 187 | /** |
@@ -224,8 +221,7 @@ public class EditImplementEntity { | ||
224 | 221 | * 削除するアトリビュート |
225 | 222 | * @return 削除したアトリビュート。アトリビュートが存在しなかった場合はnullを返す。 |
226 | 223 | */ |
227 | - public EditImplementAttribute removeAttribute( | |
228 | - EditImplementAttribute attribute) { | |
224 | + public EditImplementAttribute removeAttribute(EditImplementAttribute attribute) { | |
229 | 225 | int index = attributes.indexOf(attribute); |
230 | 226 | if (index >= 0) { |
231 | 227 | EditImplementAttribute removed = attributes.remove(index); |
@@ -340,7 +336,8 @@ public class EditImplementEntity { | ||
340 | 336 | } |
341 | 337 | |
342 | 338 | /** |
343 | - * @param implementName the implementName to set | |
339 | + * @param implementName | |
340 | + * the implementName to set | |
344 | 341 | */ |
345 | 342 | public void setImplementName(String implementName) { |
346 | 343 | this.implementName = implementName; |
@@ -366,8 +363,7 @@ public class EditImplementEntity { | ||
366 | 363 | * @param newValue |
367 | 364 | * 変更後の値 |
368 | 365 | */ |
369 | - public void firePropertyChange(String propName, Object oldValue, | |
370 | - Object newValue) { | |
366 | + public void firePropertyChange(String propName, Object oldValue, Object newValue) { | |
371 | 367 | listeners.firePropertyChange(propName, oldValue, newValue); |
372 | 368 | } |
373 | 369 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* |
2 | - * Copyright 2009-2011 TMD-Maker Project <http://tmdmaker.sourceforge.jp/> | |
2 | + * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/> | |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -18,7 +18,7 @@ package jp.sourceforge.tmdmaker.dialog.model; | ||
18 | 18 | import jp.sourceforge.tmdmaker.model.AbstractEntityModel; |
19 | 19 | import jp.sourceforge.tmdmaker.model.Attribute; |
20 | 20 | import jp.sourceforge.tmdmaker.model.IAttribute; |
21 | -import jp.sourceforge.tmdmaker.model.SarogateKey; | |
21 | +import jp.sourceforge.tmdmaker.model.SurrogateKey; | |
22 | 22 | |
23 | 23 | /** |
24 | 24 | * 編集用サロゲートキー |
@@ -26,7 +26,7 @@ import jp.sourceforge.tmdmaker.model.SarogateKey; | ||
26 | 26 | * @author nakaG |
27 | 27 | * |
28 | 28 | */ |
29 | -public class EditSarogateKey extends EditImplementAttribute { | |
29 | +public class EditSurrogateKey extends EditImplementAttribute { | |
30 | 30 | private boolean enabled; |
31 | 31 | private boolean added; |
32 | 32 |
@@ -38,8 +38,8 @@ public class EditSarogateKey extends EditImplementAttribute { | ||
38 | 38 | * @param original |
39 | 39 | * サロゲートキー |
40 | 40 | */ |
41 | - public EditSarogateKey(AbstractEntityModel containerModel, | |
42 | - SarogateKey original) { | |
41 | + public EditSurrogateKey(AbstractEntityModel containerModel, | |
42 | + SurrogateKey original) { | |
43 | 43 | super(containerModel, original); |
44 | 44 | if (original == null) { |
45 | 45 | enabled = false; |
@@ -82,7 +82,7 @@ public class EditSarogateKey extends EditImplementAttribute { | ||
82 | 82 | */ |
83 | 83 | @Override |
84 | 84 | public Attribute getOriginalAttribute() { |
85 | - SarogateKey sarogeteKey = (SarogateKey) super.getOriginalAttribute(); | |
85 | + SurrogateKey sarogeteKey = (SurrogateKey) super.getOriginalAttribute(); | |
86 | 86 | if (added) { |
87 | 87 | getEditAttribute().copyTo(sarogeteKey); |
88 | 88 | } |
@@ -97,8 +97,8 @@ public class EditSarogateKey extends EditImplementAttribute { | ||
97 | 97 | @Override |
98 | 98 | public void copyTo(IAttribute to) { |
99 | 99 | super.copyTo(to); |
100 | - if (to instanceof SarogateKey) { | |
101 | - ((SarogateKey) to).setEnabled(enabled); | |
100 | + if (to instanceof SurrogateKey) { | |
101 | + ((SurrogateKey) to).setEnabled(enabled); | |
102 | 102 | } |
103 | 103 | } |
104 | 104 |
@@ -110,7 +110,7 @@ public class EditSarogateKey extends EditImplementAttribute { | ||
110 | 110 | @Override |
111 | 111 | public void copyToOriginal() { |
112 | 112 | super.copyToOriginal(); |
113 | - ((SarogateKey) getOriginalAttribute()).setEnabled(enabled); | |
113 | + ((SurrogateKey) getOriginalAttribute()).setEnabled(enabled); | |
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -124,8 +124,8 @@ public class EditSarogateKey extends EditImplementAttribute { | ||
124 | 124 | if (this == obj) { |
125 | 125 | return true; |
126 | 126 | } |
127 | - if (obj instanceof EditSarogateKey) { | |
128 | - EditSarogateKey other = (EditSarogateKey) obj; | |
127 | + if (obj instanceof EditSurrogateKey) { | |
128 | + EditSurrogateKey other = (EditSurrogateKey) obj; | |
129 | 129 | return super.equals(other) && |
130 | 130 | getEditAttribute().equals(other.getEditAttribute()); |
131 | 131 | } |