List of usage examples for com.vaadin.v7.data.util MethodProperty MethodProperty
@SuppressWarnings("unchecked") public MethodProperty(Object instance, String beanPropertyName)
Creates a new instance of MethodProperty from a named bean property.
From source file:org.jpos.qi.EntityContainer.java
License:Open Source License
protected Object getPojoId(Object entity) { return new MethodProperty(entity, "id").getValue(); }
From source file:org.jpos.qi.EntityContainer.java
License:Open Source License
public void updateItem(Item item) { clearInternalCache();//from w w w . ja 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); }
From source file:org.jpos.qi.EntityItem.java
License:Open Source License
public Property getItemProperty(Object attribute) { return new MethodProperty(entity, attribute.toString()); }