Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Data Access

Qcadoo framework provides a generic crud layer for database entities. All its methods are contained in DataDefinition interface. To get the problem instance of the data definition object You should use DataDefinitionService#get(String,String) method.

CRUD operations examples

DataDefinition dd = dataDefinitionService.get("plugin", "model");

Entity e1 = dd.create();
e1.setField("name", "xxx");
Entity e2 = dd.save(e1);

if(e2.isValid()) {
    Entity e3 = dd.get(e2.getId());
    e3.setField("name", "yyy");
    dd.save(e3);

    dd.delete(e3);
}
  • No labels