Hibernate version: 3.0.5
Having two tables:
TBFRUITS ________ ID_FRUIT ID_COLOR
TBTRANSLATECOLORS _________________ ID_COLOR ID_LANGUAGE
I'm desesperatelly trying to make a left outer join with only a primary key on the left joined table, but hibernate obligates me to put all primery keys on the hbm
tbfruits.hbm.xml <many-to-one name="tbtranslatecolors" class="com.mymodel.dto.Tbtranslatecolors" fetch="select"> <column name="ID_COLOR" length="7" /> <column name="ID_LANGUAGE" length="3" /> </many-to-one>
the following HQL:
FROM com.mymodel.dto.Tbfruits AS tf left join fetch tf.tbtranslatecolors AS tc
produces a left join for both primary keys on the left joined tbtranslate colors but I only ONE COLUMN so trying to left join ON ID_COLOR
FROM com.mymodel.dto.Tbfruits AS tf left join fetch tf.tbtranslatecolors AS tc on tf.idcolor = tc.idcolor
but this produces a
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 4, column 1
So how can I obligate HQL to produce a left join only on id_color ?
TIA
|