List of usage examples for com.vaadin.v7.data.util MethodProperty setValue
@Override public void setValue(T newValue) throws Property.ReadOnlyException
From source file:org.jpos.qi.EntityContainer.java
License:Open Source License
public void updateItem(Item item) { clearInternalCache();//from w w w.j a v a 2 s.c o m Object id = item.getItemProperty("id").getValue(); try { DB.execWithTransaction((db) -> { Object obj = db.session().get(clazz, (Serializable) id); for (String propertyId : props.keySet()) { MethodProperty<Object> p = new MethodProperty<>(obj, propertyId); if (!p.isReadOnly()) p.setValue(item.getItemProperty(propertyId).getValue()); } db.session().update(obj); ((EntityItem) item).setEntity(obj); // refresh entity return null; }); } catch (Exception e) { QI.getQI().getLog().error(e); } fireContentsChange(-1); }