Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:[/b]
2.1
I have 2 related tables and the first table for the same selection criteria has more rows than the other. I would like to run an outer join in such a way that for the additional rows from the first table I would still see the result with the values from the second table as NULL. In isql I can simply move the match criteria from the "where" clause to the "from" clause. However, I can't figure out how to make Hibernate translate my HQL in such way.
My HQL:
"from LegalEntitySynonym as leSyn "+
"left join leSyn.legalEntity as le "+
"and leSyn.synonymType = ID' "+
"where le.legalEntityName like '%ELIGIBLE%' ";
gets translated in something like:
select .....
from legal_entity legalentit1_
left join legal_entity_synonym legalentit0_ on legalentit0_.legal_entity_id=legalentit1_.legal_entity_id
legalentit1_.legal_entity_id=accounts2_.legal_entity_id
where (legalentit1_.legal_entity_name like '%ELIGIBLE%' )
and (legalentit0_.synonym_type_code='ID' )
while I want it to be:
select .....
from legal_entity legalentit1_
left join legal_entity_synonym legalentit0_ on legalentit0_.legal_entity_id=legalentit1_.legal_entity_id
and (legalentit0_.synonym_type_code='ID' )
legalentit1_.legal_entity_id=accounts2_.legal_entity_id
where (legalentit1_.legal_entity_name like '%ELIGIBLE%' )
What can I do about it?