Example usage for com.vaadin.v7.data.util MethodProperty isReadOnly

List of usage examples for com.vaadin.v7.data.util MethodProperty isReadOnly

Introduction

In this page you can find the example usage for com.vaadin.v7.data.util MethodProperty isReadOnly.

Prototype

@Override
public boolean isReadOnly() 

Source Link

Document

Tests if the object is in read-only mode.

Usage

From source file:org.jpos.qi.EntityContainer.java

License:Open Source License

public void updateItem(Item item) {
    clearInternalCache();//from w  w w.  ja  va  2s .co  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);
}