Joined: Tue May 04, 2010 4:15 pm Posts: 1
|
I'm sure this is a question that would have been asked many many times. However, I could not find one that suites my situation . Please help.
I have 2 tables parent and child. Structure as below
Parent ------ ID Name
Child ----- ID Dttm Name xyz abc
Java for Parent ----------- Class Parent{ private long ID; private String Name; Set <Child> children; } with getters and setters
Its a one to many relationship from parent to child. Parent's PK is ID generated through a sequence and child should use the same ID (same sequence number generated for parent). ID and Dttm (date time) makes the unique key on the child. When i insert a parent with the set filled for child i need to be able to cascade the save. How does the hbm mapping look for this situation ?
|
|