Revision 46714
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/editing/memory/FeatureManager.java | ||
---|---|---|
194 | 194 |
|
195 | 195 |
public int update(EditableFeature feature, Feature oldFeature) { |
196 | 196 |
FeatureReference id = feature.getReference(); |
197 |
if(id == null){ |
|
198 |
throw new IllegalArgumentException("Can't update feature without references support."); |
|
199 |
} |
|
197 | 200 |
if(!original.containsKey(id)){ |
198 | 201 |
int n = expansionAdapter.addObject(oldFeature); |
199 | 202 |
original.put(id, n); |
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/DefaultFeatureStore.java | ||
---|---|---|
1343 | 1343 |
synchronized public void edit(int mode) throws DataException { |
1344 | 1344 |
LOGGER.debug("Starting editing in mode: {}", mode); |
1345 | 1345 |
FeatureType ftype = this.getDefaultFeatureType(); |
1346 |
if(!ftype.supportReferences()){ |
|
1347 |
throw new UnsupportedOperationException("Can't edit store without references support."); |
|
1348 |
} |
|
1349 | 1346 |
String newSessionCode = this.createUniqueID(); |
1350 | 1347 |
try { |
1351 | 1348 |
if (this.mode != MODE_QUERY) { |
... | ... | |
1359 | 1356 |
throw new IllegalStateException(this.getName()); |
1360 | 1357 |
|
1361 | 1358 |
case MODE_FULLEDIT: |
1362 |
if (!this.transforms.isEmpty()) {
|
|
1359 |
if (!this.transforms.isEmpty()) { |
|
1363 | 1360 |
throw new IllegalStateException(this.getName()); |
1364 | 1361 |
} |
1365 | 1362 |
if (notifyChange(FeatureStoreNotification.BEFORE_STARTEDITING, |
... | ... | |
1768 | 1765 |
notifyChange(FeatureStoreNotification.AFTER_UPDATE, feature); |
1769 | 1766 |
break; |
1770 | 1767 |
case MODE_FULLEDIT: |
1768 |
if(!feature.getType().supportReferences()){ |
|
1769 |
throw new UnsupportedOperationException("Can't update store in full edit mode without references support."); |
|
1770 |
} |
|
1771 | 1771 |
if (feature.isUpdatable()) { |
1772 | 1772 |
commands.update(feature, feature.getSource()); |
1773 | 1773 |
return; |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/operations/PerformChangesOperation.java | ||
---|---|---|
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
public String getUpdateSQL(JDBCSQLBuilderBase sqlbuilder) { |
242 |
if(!this.featureType.hasPrimaryKey()) { |
|
243 |
throw new RuntimeException("Operation requires missing pk"); |
|
244 |
} |
|
242 | 245 |
GeometryExpressionBuilder expbuilder = sqlbuilder.expression(); |
243 | 246 |
|
244 | 247 |
sqlbuilder.update().table() |
Also available in: Unified diff