-->
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 to children,child to child using parent and child?
PostPosted: Mon Oct 06, 2008 10:21 am 
Newbie

Joined: Fri May 11, 2007 3:04 am
Posts: 3
>= 3.2.5:
Is it possible to make a one to many connection from the parent to these children, and also have the children have a one to one connection ?
Or can you make a one to many from the parent to child_one, and a one-to-one to child_two using key from child_one and the parent?

Table parent
p_col1, composite key part 1
p_col2 composite key part 2
p_col4,
p_col5,
p_col6,
p_col7

Child table child_one:
co_col1, composite key part 1
co_col2, composite key part 2
co_col3, composite key part 3,
co_col4

Child table child_two:
ct_col3, composite key part 1
ct_col4, composite key part 2
ct_col5, composite key part 3
ct_col6, composite key part 4
ct_col7

The mapping in a sql statement would look like this:
select * from parent p,child_one co,child_two ct
where p.p_col1 = co.col1
and p.p_col2 = co.col2
and p.p_col4 = ct.col4
and p.p_col5 = ct.col5
and p.p_col6 = ct.col6
and co.col3 = ct.col3

Kind regards Roger


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.