How to save date with business object aggregation relation?


How to save data in h2 database with business objects aggregation relation?

this is .bos:

after execution of this process , there are no data in H2 database?

with business objects composite relation, i can found data in h2 but i need to use business object aggregation relation?

1 answer



aggregation relation mean that attribute of this type must exist prior to add them.

in your .bos, object msh & pid must exists before your process start. use a dedicated process to create them, and then retrieve their internal id using a BDM query of your choice.

see for more information

def adA04Var = new adA04Var.ada04seg = { //Retrieve aggregated Segment using its DAO and persistenceId def segmentVar = segmentDAO.findByPersistenceId(adaInput.ada04seg.persistenceId.toLong()) segmentVar.msh1 = { //Retrieve aggregated Msh using its DAO and persistenceId def mshVar = mshDAO.findByPersistenceId(adaInput.ada04seg.msh1.persistenceId.toLong()) mshVar.attribut1 = adaInput.ada04seg.msh1.attribut1 return mshVar}() segmentVar.pid1 = { //Retrieve aggregated Pid using its DAO and persistenceId def pidVar = pidDAO.findByPersistenceId(adaInput.ada04seg.pid1.persistenceId.toLong()) pidVar.attribut3 = adaInput.ada04seg.pid1.attribut3 return pidVar}() return segmentVar}() return adA04Var


Submitted by maouachria on Wed, 09/04/2019 - 11:58

thanks laurent;
please, have you any example (to set the business variable attributes values )?