-->
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.  [ 3 posts ] 
Author Message
 Post subject: How do I map this: (collection key != parent primary key)
PostPosted: Mon Mar 08, 2004 11:07 am 
Newbie

Joined: Tue Feb 17, 2004 2:51 pm
Posts: 10
Hello!

What I want is to map a one-to-many from
PARENT to CHILD using collection_id.

Judging from previous posts I get the impression this can't be expressed in the mapping, but instead I would need a custom getChildren() method which does a HQL query, it that correct?

(This is legacy data)

PARENT_TABLE
============
parent_id (PRIMARY KEY)
collection_id (UNIQUE)


CHILD_TABLE
===========
child_id (PRIMARY KEY)
collection_id


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 4:06 pm 
Beginner
Beginner

Joined: Fri Mar 05, 2004 11:14 am
Posts: 38
Location: Houston, Texas
Exact same problem I have !

Even more intrigue since my situation is

PARENT_TABLE
============
parent_id (PRIMARY KEY)
parent_collection_id (UNIQUE)


CHILD_TABLE
===========
child_id (PRIMARY KEY)
child_collection_id


i.e. one-to-many from PARENT to CHILD using parent_collection_id against child_collection_id

B


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 11, 2004 4:47 pm 
Beginner
Beginner

Joined: Fri Mar 05, 2004 11:14 am
Posts: 38
Location: Houston, Texas
See related post at

http://forum.hibernate.org/viewtopic.ph ... 09#2194509


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

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.