-->
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: Simple Join Problem
PostPosted: Mon Apr 09, 2007 8:19 pm 
Newbie

Joined: Mon Apr 09, 2007 8:02 pm
Posts: 1
I know this should be pretty simple, but I have been a couple days trying to figure it out and I just cannot find a solution!

This is what I have...

Code:
<class name="Sale" table="sale" schema="public">
        <id name="saleid">
            <generator class="native" />
        </id>

       <property name="contactid" />
      
       <join table="getclient" optional="true">
          <key unique="true" column="contactid" property-ref="contactid"/>
          <property name="clientname" column="name"/>
       </join>
</class>


This is what Hibernate does when accessing the clientname property...

Code:
select sale0_.contactid as contactid4_0_,
        sale0_1_.name as name6_0_
from
        public.sale sale0_
left outer join
        getclient sale0_1_
           on sale0_.saleid=sale0_1_.contactid
where
        sale0_.saleid=?


And what I am expecting is the JOIN to be like...

on sale0_.contactid=sale0_1_.contactid

I am using the latest Hibernate, Postgres 7.4 and Java 1.5. Thank you in advance for any help!


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.