@Test public void testDelete() throws Exception { HibernateTestFeature f1 = (HibernateTestFeature) layer.create(HibernateTestFeature.getDefaultInstance1(null)); Assert.assertNotNull(f1.getId()); Assert.assertNotNull(layer.read(f1.getId().toString())); layer.delete(f1.getId().toString()); try { layer.read(f1.getId().toString()); Assert.fail("No exception thrown for non-exisiting feature"); } catch (LayerException e) { } }
@Override public void delete(String featureId) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.delete(getFeature(featureId)); session.flush(); }
HibernateLayer extends HibernateLayerUtil implements VectorLayer, VectorLayerAssociationSupport,
		VectorLayerLazyFeatureConversionSupport { @Override public void delete(String featureId) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.delete(getFeature(featureId)); session.flush(); } }
HibernateLayer extends HibernateLayerUtil implements VectorLayer, VectorLayerAssociationSupport,
		VectorLayerLazyFeatureConversionSupport { @Override public void delete(String featureId) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.delete(getFeature(featureId)); session.flush(); }  }
HibernateLayer extends HibernateLayerUtil implements VectorLayer, VectorLayerAssociationSupport,
		VectorLayerLazyFeatureConversionSupport { @Override public void delete(String featureId) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.delete(getFeature(featureId)); session.flush(); }  @Override String getId(); @Api void setId(String id); @Override CoordinateReferenceSystem getCrs(); @Override FeatureModel getFeatureModel(); @Override boolean useLazyFeatureConversion(); @Api void setUseLazyFeatureConversion(boolean useLazyFeatureConversion); @Api @Override void setLayerInfo(VectorLayerInfo layerInfo); @Override boolean isCreateCapable(); @Override boolean isUpdateCapable(); @Override boolean isDeleteCapable(); @Api void setFeatureModel(FeatureModel featureModel); @Api void setSessionFactory(SessionFactory sessionFactory); Iterator<?> getElements(Filter filter, int offset, int maxResultSize); @Override Object create(Object feature); @Override Object saveOrUpdate(Object feature); @Override void delete(String featureId); @Override Object read(String featureId); void update(Object feature); @Override Envelope getBounds(); Envelope getBounds(Filter filter); @Override List<Attribute<?>> getAttributes(String attributeName, Filter filter); DateFormat getDateFormat(); void setDateFormat(DateFormat dateFormat); boolean isScrollableResultSet(); @Api void setScrollableResultSet(boolean scrollableResultSet); }
HibernateLayer extends HibernateLayerUtil implements VectorLayer, VectorLayerAssociationSupport,
		VectorLayerLazyFeatureConversionSupport { @Override public void delete(String featureId) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.delete(getFeature(featureId)); session.flush(); }  @Override String getId(); @Api void setId(String id); @Override CoordinateReferenceSystem getCrs(); @Override FeatureModel getFeatureModel(); @Override boolean useLazyFeatureConversion(); @Api void setUseLazyFeatureConversion(boolean useLazyFeatureConversion); @Api @Override void setLayerInfo(VectorLayerInfo layerInfo); @Override boolean isCreateCapable(); @Override boolean isUpdateCapable(); @Override boolean isDeleteCapable(); @Api void setFeatureModel(FeatureModel featureModel); @Api void setSessionFactory(SessionFactory sessionFactory); Iterator<?> getElements(Filter filter, int offset, int maxResultSize); @Override Object create(Object feature); @Override Object saveOrUpdate(Object feature); @Override void delete(String featureId); @Override Object read(String featureId); void update(Object feature); @Override Envelope getBounds(); Envelope getBounds(Filter filter); @Override List<Attribute<?>> getAttributes(String attributeName, Filter filter); DateFormat getDateFormat(); void setDateFormat(DateFormat dateFormat); boolean isScrollableResultSet(); @Api void setScrollableResultSet(boolean scrollableResultSet);  }