Revision 43840 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
DefaultFeatureStore.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
package org.gvsig.fmap.dal.feature.impl; |
26 | 26 |
|
27 |
import org.gvsig.fmap.dal.feature.impl.editing.memory.SpatialManager; |
|
28 |
import org.gvsig.fmap.dal.feature.impl.editing.memory.FeatureTypeManager; |
|
29 |
import org.gvsig.fmap.dal.feature.impl.editing.memory.FeatureManager; |
|
27 | 30 |
import org.gvsig.fmap.dal.feature.spi.SQLBuilderBase; |
28 | 31 |
|
29 | 32 |
import java.util.ArrayList; |
... | ... | |
108 | 111 |
import org.gvsig.fmap.dal.feature.exception.StoreUpdateFeatureTypeException; |
109 | 112 |
import org.gvsig.fmap.dal.feature.exception.ValidateFeaturesException; |
110 | 113 |
import org.gvsig.fmap.dal.feature.exception.WriteNotAllowedException; |
111 |
import org.gvsig.fmap.dal.feature.impl.expansionadapter.MemoryExpansionAdapter; |
|
112 | 114 |
import org.gvsig.fmap.dal.feature.impl.featureset.DefaultFeatureSet; |
113 | 115 |
import org.gvsig.fmap.dal.feature.impl.dynobjectutils.DynObjectFeatureFacade; |
114 | 116 |
import org.gvsig.fmap.dal.feature.impl.undo.DefaultFeatureCommandsStack; |
... | ... | |
222 | 224 |
private boolean broken; |
223 | 225 |
private Throwable breakingsCause; |
224 | 226 |
|
227 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
225 | 228 |
public StateInformation() { |
226 | 229 |
this.clear(); |
227 | 230 |
} |
... | ... | |
474 | 477 |
} |
475 | 478 |
|
476 | 479 |
/** |
480 |
* @throws org.gvsig.fmap.dal.exception.DataException |
|
477 | 481 |
* @deprecated use getDefaultFeatureType().getDefaultSRS() |
478 | 482 |
*/ |
479 | 483 |
@Override |
... | ... | |
1072 | 1076 |
} |
1073 | 1077 |
notifyChange(FeatureStoreNotification.BEFORE_STARTEDITING); |
1074 | 1078 |
invalidateIndexes(); |
1075 |
featureManager = |
|
1076 |
new FeatureManager(new MemoryExpansionAdapter()); |
|
1077 |
featureTypeManager = |
|
1078 |
new FeatureTypeManager(this, new MemoryExpansionAdapter()); |
|
1079 |
spatialManager = |
|
1080 |
new SpatialManager(this, provider.getEnvelope()); |
|
1079 |
featureManager = new FeatureManager(); |
|
1080 |
featureTypeManager = new FeatureTypeManager(this); |
|
1081 |
spatialManager = new SpatialManager(this, provider.getEnvelope()); |
|
1081 | 1082 |
|
1082 |
commands = |
|
1083 |
new DefaultFeatureCommandsStack(this, featureManager,
|
|
1083 |
commands = new DefaultFeatureCommandsStack(
|
|
1084 |
this, featureManager,
|
|
1084 | 1085 |
spatialManager, featureTypeManager); |
1085 | 1086 |
this.mode = MODE_FULLEDIT; |
1086 | 1087 |
hasStrongChanges = false; |
... | ... | |
1512 | 1513 |
featureTypeManager.getFeatureTypesChanged()); |
1513 | 1514 |
} |
1514 | 1515 |
invalidateIndexes(); |
1515 |
featureManager = |
|
1516 |
new FeatureManager(new MemoryExpansionAdapter()); |
|
1517 |
featureTypeManager = |
|
1518 |
new FeatureTypeManager(this, new MemoryExpansionAdapter()); |
|
1519 |
spatialManager = |
|
1520 |
new SpatialManager(this, provider.getEnvelope()); |
|
1516 |
featureManager = new FeatureManager(); |
|
1517 |
featureTypeManager = new FeatureTypeManager(this); |
|
1518 |
spatialManager = new SpatialManager(this, provider.getEnvelope()); |
|
1521 | 1519 |
|
1522 | 1520 |
commands = |
1523 | 1521 |
new DefaultFeatureCommandsStack(this, featureManager, |
... | ... | |
1603 | 1601 |
FeatureType targetType = target.getDefaultFeatureType(); |
1604 | 1602 |
|
1605 | 1603 |
target.edit(MODE_APPEND); |
1606 |
FeatureAttributeDescriptor[] pk = type.getPrimaryKey(); |
|
1604 |
FeatureAttributeDescriptor[] pkattrs = type.getPrimaryKey();
|
|
1607 | 1605 |
if (featureSelection.getSize() > 0) { |
1608 | 1606 |
features = this.getFeatureSelection(); |
1609 | 1607 |
} else { |
1610 |
if ((pk != null) && (pk.length > 0)) {
|
|
1608 |
if ((pkattrs != null) && (pkattrs.length > 0)) {
|
|
1611 | 1609 |
FeatureQuery query = createFeatureQuery(); |
1612 |
for (int i = 0; i < pk.length; i++) {
|
|
1613 |
query.getOrder().add(pk[i].getName(), true);
|
|
1610 |
for (FeatureAttributeDescriptor pkattr : pkattrs) {
|
|
1611 |
query.getOrder().add(pkattr.getName(), true);
|
|
1614 | 1612 |
} |
1615 | 1613 |
features = this.getFeatureSet(query); |
1616 | 1614 |
} else { |
... | ... | |
2435 | 2433 |
try{ |
2436 | 2434 |
throw new IllegalStateException(); |
2437 | 2435 |
} catch(IllegalStateException e) { |
2438 |
LOG.info("Call DefaultFeatureStore.getFeatureCount editing in mode APPEND"); |
|
2439 |
e.printStackTrace(); |
|
2436 |
LOG.info("Call DefaultFeatureStore.getFeatureCount editing in mode APPEND",e); |
|
2440 | 2437 |
} |
2441 | 2438 |
return -1; |
2442 | 2439 |
} else { |
... | ... | |
2617 | 2614 |
} |
2618 | 2615 |
|
2619 | 2616 |
@Override |
2617 |
@SuppressWarnings("CloneDoesntCallSuperClone") |
|
2620 | 2618 |
public Object clone() throws CloneNotSupportedException { |
2621 | 2619 |
|
2622 | 2620 |
DataStoreParameters dsp = getParameters(); |
Also available in: Unified diff