Revision 44261 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
DefaultFeatureType.java | ||
---|---|---|
149 | 149 |
attr = (DefaultFeatureAttributeDescriptor) iter.next(); |
150 | 150 |
this.intitalizeAddAttibute(attr); |
151 | 151 |
} |
152 |
if (other.pk != null) { |
|
153 |
this.pk = new FeatureAttributeDescriptor[other.pk.length]; |
|
154 |
for (int i = 0; i < other.pk.length; i++) { |
|
155 |
this.pk[i] = other.pk[i].getCopy(); |
|
156 |
} |
|
157 |
} |
|
152 |
this.pk = null; |
|
158 | 153 |
} |
159 | 154 |
this.defaultGeometryAttributeName = other.defaultGeometryAttributeName; |
160 | 155 |
this.defaultTimeAttributeName = other.defaultTimeAttributeName; |
... | ... | |
965 | 960 |
((DefaultFeatureAttributeDescriptor) element).setFeatureType(this); |
966 | 961 |
super.add(element); |
967 | 962 |
} |
968 |
|
|
969 |
List<String> thePk = state.getList("pk"); |
|
970 |
if (thePk == null) { |
|
971 |
this.pk = null; |
|
972 |
} else { |
|
973 |
this.pk = new FeatureAttributeDescriptor[thePk.size()]; |
|
974 |
for (int i = 0; i < pk.length; i++) { |
|
975 |
pk[i] = this.getAttributeDescriptor(thePk.get(i)); |
|
976 |
} |
|
977 |
} |
|
963 |
this.pk = null; |
|
978 | 964 |
this.fixAll(); |
979 | 965 |
} |
980 | 966 |
|
... | ... | |
992 | 978 |
state.set("hasOID", hasOID); |
993 | 979 |
state.set("allowAtomaticValues", allowAtomaticValues); |
994 | 980 |
|
995 |
List<String> thePk = null; |
|
996 |
if (this.pk != null) { |
|
997 |
thePk = new ArrayList<>(); |
|
998 |
for (FeatureAttributeDescriptor attrdesc : this.pk) { |
|
999 |
thePk.add(attrdesc.getName()); |
|
1000 |
} |
|
1001 |
} |
|
1002 |
state.set("pk", thePk); |
|
1003 |
|
|
1004 | 981 |
state.set("requiredFields", requiredFields); |
1005 | 982 |
state.set("internalID", internalID); |
1006 | 983 |
|
... | ... | |
1035 | 1012 |
definition.addDynFieldBoolean("hasOID"); |
1036 | 1013 |
definition.addDynFieldBoolean("allowAtomaticValues"); |
1037 | 1014 |
|
1038 |
definition.addDynFieldArray("pk") |
|
1039 |
.setClassOfItems(String.class); |
|
1040 |
|
|
1041 | 1015 |
definition.addDynFieldBoolean("requiredFields"); |
1042 | 1016 |
definition.addDynFieldString("internalID"); |
1043 | 1017 |
|
Also available in: Unified diff