/** * Updates the given {@link Feature} instance. * * TODO Use a copy of the original feature to avoid modifications on rollback. Difficult part: Consider updating of * references. * * @param feature * feature to be updated, must not be <code>null</code> * @param replacementProps * properties to be replaced, must not be <code>null</code> * @throws FeatureStoreException * if the update would result in an invalid feature instance */ public void update( final Feature feature, final List<ParsedPropertyReplacement> replacementProps ) throws FeatureStoreException { for ( final ParsedPropertyReplacement replacement : replacementProps ) { update( feature, replacement ); } }
@Override public boolean visitGeometry( final Geometry geom ) { checkForDuplication( geom.getId() ); return true; }
private void checkForDuplicateIds( final Feature feature ) throws FeatureStoreException { final IdChecker idChecker = new IdChecker(); try { new GMLObjectWalker( idChecker ).traverse( feature ); } catch ( final Exception e ) { throw new FeatureStoreException( e.getMessage() ); } }
features = fs.query( query ); for ( final Feature feature : features ) { new FeatureUpdater().update( feature, replacementProps ); updateFeatureBlob( blobUpdateStmt, feature ); updatedFids.add( feature.getId() );
private void update( final Feature feature, final ParsedPropertyReplacement replacement ) throws FeatureStoreException { final List<Property> targetProps = getTargetProperties( feature, replacement.getValueReference() ); Property prop = replacement.getNewValue(); UpdateAction updateAction = replacement.getUpdateAction(); validateProperties( feature, feature.getProperties() ); checkForDuplicateIds( feature );
new FeatureUpdater().update( feature, replacementProps ); if ( lock != null ) { lock.release( feature.getId() );
@Override public boolean visitFeature( final Feature feature ) { checkForDuplication( feature.getId() ); return true; }
@Override public boolean visitObject( final GMLObject o ) { checkForDuplication( o.getId() ); return true; }