Hello Cuba Team!!
I have two tables- PlanData and YearsValue
YearsValue has many-to-one relationship with PlanData table and PlanData has One-to-many relationship with YearsValue table.
public void savePlanData() {
CommitContext commitContext = new CommitContext();
for(Object obj : newPlanDatasDs.getItems()){
NewPlanData p = (NewPlanData) obj;
for(YearsValue yearsValue:p.getYears()){
yearsValue.setNewPlanData(p);
commitContext.addInstanceToCommit(yearsValue);
}
}
dataManager.commit(commitContext);
newPlanDatasDs.commit();
}
Please find the attachment for reference.
Could you please say how to save these two tables.
Thanks,
Sushma