Hi, I have the following HQL
FROM Object1 obj1
INNER JOIN obj1.set1 set1
INNER JOIN obj1.eqTextTs set2
WHERE (obj1.hideQuestion = 0)
AND (set1.id = :policy)
AND (obj1.secondId = 0)
AND (set1.comp_id.id = :id
OR set1.comp_id.id = - 1)
ORDER BY obj1.num
The relationship refered to as set1 is joing to obj1 with its primary key, how ever this is not what I want, I'd like obj1 to join to set1 using a different column and not its primary key column.
My hbm.xml files contain the correct colum references but when I view the sql hibernate is producing for this query it still trys to join using obj1's primary key.
Is it possible to join to a column that isn't the primary key in hibernate if so how is it achieved?
Thanks,
Si
|