TransformFeatureStore extends TransformFeatureSource implements SimpleFeatureStore { @Override public void modifyFeatures(Name[] attributeNames, Object[] attributeValues, Filter filter) throws IOException { String[] simpleNames = new String[attributeNames.length]; for (int i = 0; i < attributeNames.length; i++) { simpleNames[i] = attributeNames[i].getLocalPart(); } modifyFeatures(simpleNames, attributeValues, filter); } TransformFeatureStore(SimpleFeatureStore store, Name name, List<Definition> definitions); @Override void setTransaction(Transaction transaction); @Override Transaction getTransaction(); @Override void removeFeatures(Filter filter); @Override List<FeatureId> addFeatures(
            FeatureCollection<SimpleFeatureType, SimpleFeature> collection); @Override void setFeatures(FeatureReader<SimpleFeatureType, SimpleFeature> reader); @Override void modifyFeatures(Name[] attributeNames, Object[] attributeValues, Filter filter); @Override void modifyFeatures(AttributeDescriptor[] type, Object[] value, Filter filter); @Override void modifyFeatures(Name attributeName, Object attributeValue, Filter filter); @Override void modifyFeatures(AttributeDescriptor type, Object value, Filter filter); @Override void modifyFeatures(String name, Object attributeValue, Filter filter); @Override void modifyFeatures(String[] nameArray, Object[] attributeValues, Filter filter);  }
@Test public void testUpdateOnSelection() throws Exception { SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithSelection(); transformed.modifyFeatures("persons", 0, CQL.toFilter("state_name = 'Illinois'")); assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size()); SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("persons = 0"))); assertEquals(1, rfc.size()); SimpleFeatureIterator fi = rfc.features(); try { assertTrue(fi.hasNext()); SimpleFeature sf = fi.next(); assertEquals("Illinois", sf.getAttribute("state_name")); } finally { fi.close(); } }
@Test public void testUpdateOnRename() throws Exception { SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithRename(); transformed.modifyFeatures("people", 0, CQL.toFilter("name = 'Illinois'")); assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size()); SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("people = 0"))); assertEquals(1, rfc.size()); SimpleFeatureIterator fi = rfc.features(); try { assertTrue(fi.hasNext()); SimpleFeature sf = fi.next(); assertEquals("Illinois", sf.getAttribute("name")); } finally { fi.close(); } }
@Test public void testUpdateOnTransform() throws Exception { SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithPartialTransform(); transformed.modifyFeatures("people", 0, CQL.toFilter("name = 'illinois'")); assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("persons = 0"))).size()); SimpleFeatureCollection rfc = transformed.getFeatures(new Query(null, CQL.toFilter("people = 0"))); assertEquals(1, rfc.size()); SimpleFeatureIterator fi = rfc.features(); try { assertTrue(fi.hasNext()); SimpleFeature sf = fi.next(); assertEquals("illinois", sf.getAttribute("name")); } finally { fi.close(); } }