use of org.kie.workbench.common.screens.datamodeller.backend.server.handler.JPADomainHandler in project kie-wb-common by kiegroup.
the class DataObjectFormModelHandlerTest method createModel.
private void createModel() {
dataModel = new DataModelImpl();
dataObject = dataModel.addDataObject("Person1");
// makeTheClassPersistable
Map<String, Object> params = new HashMap<String, Object>();
params.put("persistable", true);
JPADomainHandler jpaDomainHandler = new JPADomainHandler();
jpaDomainHandler.setDefaultValues(dataObject, params);
// adding serialVersionUID field
addProperty(dataObject, DataObjectFormModelHandler.SERIAL_VERSION_UID, Long.class.getName(), false, false);
// add all base type properties
PropertyTypeFactoryImpl propertyTypeFactory = new PropertyTypeFactoryImpl();
propertyTypeFactory.getBasePropertyTypes().forEach(baseProperty -> addProperty(dataObject, baseProperty.getName(), baseProperty.getClassName(), false, false));
// add data object property
addProperty(dataObject, "address", NESTED_CLASSNAME, false, false);
// add list of data objects
addProperty(dataObject, "address_list", NESTED_CLASSNAME, true, false);
}
Aggregations