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!