Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public List<String> performUpdate( QName ftName, List<ParsedPropertyReplacement>
* @throws FeatureStoreException
* if the replace fails
*/
public String performReplace( Feature replacement, Filter filter, Lock lock, IDGenMode idGenMode )
public List<String> performReplace( Feature replacement, Filter filter, Lock lock, IDGenMode idGenMode )
throws FeatureStoreException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public List<String> performUpdate( QName ftName, List<ParsedPropertyReplacement>
}

@Override
public String performReplace( Feature replacement, Filter filter, Lock lock, IDGenMode idGenMode )
public List<String> performReplace( Feature replacement, Filter filter, Lock lock, IDGenMode idGenMode )
throws FeatureStoreException {
if ( filter instanceof IdFilter ) {
performDelete( (IdFilter) filter, lock );
Expand All @@ -571,10 +571,10 @@ public String performReplace( Feature replacement, Filter filter, Lock lock, IDG
GenericFeatureCollection col = new GenericFeatureCollection();
col.add( replacement );
List<String> ids = performInsert( col, USE_EXISTING );
if ( ids.isEmpty() || ids.size() > 1 ) {
if ( ids.isEmpty()) {
throw new FeatureStoreException( "Unable to determine new feature id." );
}
return ids.get( 0 );
return ids;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ private void checkIfFeaturesAreNotLocked( IdFilter filter, Lock lock )
}

@Override
public String performReplace( final Feature replacement, final Filter filter, final Lock lock,
public List<String> performReplace( final Feature replacement, final Filter filter, final Lock lock,
final IDGenMode idGenMode )
throws FeatureStoreException {
if ( filter instanceof IdFilter ) {
Expand All @@ -1087,10 +1087,10 @@ public String performReplace( final Feature replacement, final Filter filter, fi
final GenericFeatureCollection col = new GenericFeatureCollection();
col.add( replacement );
final List<String> ids = performInsert( col, USE_EXISTING );
if ( ids.isEmpty() || ids.size() > 1 ) {
if ( ids.isEmpty()) {
throw new FeatureStoreException( "Unable to determine new feature id." );
}
return ids.get( 0 );
return ids;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,10 @@ private void doReplace( Replace replace, Lock lock )

FeatureStoreTransaction ta = acquireTransaction( fs );
try {
String newFid = ta.performReplace( replacementFeature, filter, lock, idGenMode );
replaced.add( newFid, replace.getHandle() );
List<String> newFids = ta.performReplace( replacementFeature, filter, lock, idGenMode );
for (String newFid : newFids){
replaced.add( newFid, replace.getHandle() );
}
} catch ( FeatureStoreException e ) {
throw new OWSException( "Error performing replace: " + e.getMessage(), e, NO_APPLICABLE_CODE );
}
Expand Down