-->
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: hibernate maps "joins"??
PostPosted: Fri Apr 09, 2004 5:19 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
Hi, I am stucked in generating a mapping file for joins and need urgent help.


create table X (
ID ....
NAME...
Y_ID....
);

create table Y (
ID .....
LOCATION ...
);

( there is one - to - many relation between X and Y)

How can I tell hibernate in the mapping file that Y_ID is the ID field of table Y , so he can save me from join queries?

(Dont offer me to merge X and Y, I know -))

I mean : I want to write Select from X where Id = ".."
and in return I want to get both X attributes and acording to the matching (Y_ID) 's , all Y's attributes, together


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 7:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well if you have a one-to-many relation, you will have to map it as a such, and build your classes accordingly.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 19, 2004 4:22 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
using element - column attr in lists should be the answer
Thanks


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.