Hi,
My problem is something like the one discussed in Hibernate in Action book on page 335 related to composite key:
Say, we do have two objects
Code:
Oraganisation
{
Id orgId;
Set Users
}
Code:
UserID
{
userName;
orgID;
}
etc
userName and orgID are composite keys for object User, so the mapping gonna be
Code:
<class name="User" table="USER">
<composite-id name=userID class=UserID>
<key-property name=userName column=userName>
<key-property name=orgID column=ORG_ID>
</composite-id>
My screen creates, Organisation along with its child objects and wants to save all its childs which means the Users.
My questions are:
1. Do I need to explictly set the orgID inside the UserID key during persistence?
2. How can I avoid the step 1, if it is must? I just want to do the cascade save of child objects along with parent when it is getting created?
Thanks,
Arshad
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: