HibernateFeatureModel extends HibernateLayerUtil implements FeatureModel { @Override @SuppressWarnings("unchecked") public void setAttributes(Object feature, Map<String, Attribute> attributes) throws LayerException { entityMappingService.setAttributes(feature, getFeatureInfo(), entityMapper, (Map) attributes); }  @Override void setLayerInfo(VectorLayerInfo layerInfo); @Override Attribute getAttribute(Object feature, String name); @Override @SuppressWarnings("rawtypes") Map<String, Attribute> getAttributes(Object feature); @Override String getId(Object feature); @Override Geometry getGeometry(Object feature); @Override @SuppressWarnings("unchecked") void setAttributes(Object feature, Map<String, Attribute> attributes); @Override void setGeometry(Object feature, Geometry geometry); @Override Object newInstance(); @Override Object newInstance(String id); @Override int getSrid(); @Override String getGeometryAttributeName(); @Override boolean canHandle(Object feature);  }
@SuppressWarnings("unchecked") @Test public void setAttributes() throws Exception { Date date = new Date(); Map<String, Attribute> attributes = new HashMap<String, Attribute>(); attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name")); attributes.put(PARAM_INT_ATTR, new IntegerAttribute(5)); attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5.0f)); attributes.put(PARAM_DOUBLE_ATTR, new DoubleAttribute(5.0)); attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false)); attributes.put(PARAM_DATE_ATTR, new DateAttribute(date)); featureModel.setAttributes(feature1, attributes); Assert.assertEquals("new name", featureModel.getAttribute(feature1, PARAM_TEXT_ATTR).getValue()); Assert.assertEquals(5, featureModel.getAttribute(feature1, PARAM_INT_ATTR).getValue()); Assert.assertEquals(5.0f, featureModel.getAttribute(feature1, PARAM_FLOAT_ATTR).getValue()); Assert.assertEquals(5.0, featureModel.getAttribute(feature1, PARAM_DOUBLE_ATTR).getValue()); Assert.assertFalse((Boolean) featureModel.getAttribute(feature1, PARAM_BOOLEAN_ATTR).getValue()); Assert.assertEquals(date, featureModel.getAttribute(feature1, PARAM_DATE_ATTR).getValue()); }