...
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
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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); } |