Hi,
 
        I have a problem when trying to persist classes extending from an Object with relations . I have the following relation,
 
Hospital ----------- Department ----------- Doctor ---------------- User ----------- Access Codes
                (1-*)                        (1-*)                                  |        (1-*)
                                                                                      |
                                                                                   Patient
 
Patient and Doctor extends from User and Doctor depends on Department and Department depends on Hospital. User has many relation with access codes and depends on user. When i try to create an object of Doctor having many access codes, castor creates the Access Code object first and then Doctor object. Upon tracing through the code i found that in the FieldMolder class,
Hospital gets a priority of 0,
Dept 1,
Doctor 2 and
User 0 and
Access Code again 1.
 
 So Access code is trying to be persisted at the beginning.
 
And the doctor object gets a null value for Access code.
 
I have provided the neccessary relation ships in the mapping file.
 
Another interesting i noticed was that Ln 1453 in TransactionContext.java ( entry.updateCacheNeeded = true ) has been commented out. Was this done on purpose.
 
Hoping a reply @ the earliest.
 
Thanks
 
Arun
 

Reply via email to