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: Different Key for selecting then mapping
PostPosted: Thu Jul 19, 2007 12:07 pm 
Newbie

Joined: Mon Jul 16, 2007 5:38 pm
Posts: 9
Does anyone know of a way to select child records using one set of keys, but have them mapped to their parent using another set of keys.

For example, I have a set of parent records which I need to have children mapped to. I want the children to be mapped using KeyColumn1 and KeyColumn2, however I cannot select them from the database using KeyColumn1 and KeyColumn2. I know its a bad DB design but I am stuck with it. I have to select them from the database using KeyColumn3 and KeyColumn4.

I have thought of using a select to get all the parents, then using a select to get all the children (without using a bag or any other collection), but I dont think there is a way to hand the parent set, all the children and have the children associated to its respective parents.

Thanks and sorry for being such a newbie.


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.