-->
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: JOIN element
PostPosted: Sat Sep 17, 2005 4:59 am 
Newbie

Joined: Wed Sep 14, 2005 6:34 am
Posts: 1
There is a class which properties are stored in different tables. For example class User stored in the table users, and in the table adresses kept his full address. The table users has PRIMARY KEY id, in this table also there is a field adress_id, and in the table adresses is a field id. User is linked to the Adress on FOREIGN KEY: users.adress_id on adresses.id.
I try to create such mapping:
Code:
<hibernate-mapping>
<class name="com.User" table="users">
    <id name="id".....>
       <column name="id" ..../>           
     </id>
     <property name="adressId" ...>
           <column name="adress_id"/>
     </property>
     <join table="adresses" ....>
         <key column="id"   property-ref="adressId"/>
         <property ...../>
     </join>
</class>
</hibernate-mapping>

Expecting to receive in quiry left outer join adresses on users.adress_id = adresses.id, actually Hibernate relates tables using PRIMARY KEY users table: left outer join adresses on users.id = adresses.id.

Can someone explain why the attribute property-ref described in the documentation for an element key don't works in this case?


Top
 Profile  
 
 Post subject: because there is a bug
PostPosted: Mon Sep 19, 2005 5:00 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
It does not work because there is a bug in Hibernate.
I just tried it with current CVS trunk and it does not work with it too. Please submit bug.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 6:22 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Here's an older thread on this topic (just FYI):

http://forum.hibernate.org/viewtopic.php?t=943846&highlight=


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.