public void write() throws IOException { try { //figure out what the fid is PrimaryKey key = dataStore.getPrimaryKey(featureType); String fid = dataStore.encodeFID(key, rs); Id filter = dataStore.getFilterFactory() .id(Collections.singleton(dataStore.getFilterFactory() .featureId(fid))); //figure out which attributes changed List<AttributeDescriptor> changed = new ArrayList<AttributeDescriptor>(); List<Object> values = new ArrayList<Object>(); for (AttributeDescriptor att : featureType.getAttributeDescriptors()) { if (last.isDirrty(att.getLocalName())) { changed.add(att); values.add(last.getAttribute(att.getLocalName())); } } //do the write dataStore.update(featureType, changed, values, filter, st.getConnection()); } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }
public void write() throws IOException { try { //figure out what the fid is PrimaryKey key = dataStore.getPrimaryKey(featureType); String fid = dataStore.encodeFID(key, rs); Id filter = dataStore.getFilterFactory() .id(Collections.singleton(dataStore.getFilterFactory() .featureId(fid))); //figure out which attributes changed List<AttributeDescriptor> changed = new ArrayList<AttributeDescriptor>(); List<Object> values = new ArrayList<Object>(); for (AttributeDescriptor att : featureType.getAttributeDescriptors()) { if (last.isDirrty(att.getLocalName())) { changed.add(att); values.add(last.getAttribute(att.getLocalName())); } } // do the write dataStore.update(featureType, changed, values, filter, st.getConnection()); // issue notification ContentEntry entry = featureSource.getEntry(); ContentState state = entry.getState( this.tx ); if( state.hasListener() ){ state.fireFeatureUpdated( featureSource, last, lastBounds ); } } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }