A session bean tracker and 2 entity beans employee and timesheet.Both the entity beans are local EJB objects.Employee has one-many CMR relation with timesheet.
The tracker bean creates a local timesheet instance and passes it to employee.The employee retreives the timesheets collection ,and adds this instance to the collection.
If i populate the members of timesheet bean in ejbcreate,i get the error ===>
javax.ejb.EJBException: [EJB:010146]The setXXX method for a cmr-field that is mapped to a primary key may not be called. The cmr-field is read-only.
So i remove the population to ejbpostcreate.However in this case,i get the error===>
In EJB 'TimeSheet', the primary key field 'date' was not set during ejbCreate. All primary key fields must be initialized during ejbCreate.
how can i pass a timesheet instance from tracker to employee and ask it to store it into the timesheets collection.
All beans have CMP.