-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Parent child mapping cascaded inserts question
PostPosted: Tue May 04, 2010 4:24 pm 
Newbie

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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.