I'm trying to figure out how to generate a simple join that uses an 'or' clause contained within it, using HQL or Hibernate annotations. Here is an example of what I want the SQL to look like:
select *
from tableA
left outer join tableB
on tableA.id1 = tableB.id1
or tableA.id2 = tableB.id2
where ...
I know I can do straight SQL code for this, however, I want to take advantage of the Hibernate abstraction level. I saw @JoinColumns however this seems to be an 'and' in the join. I'm taking advantage of this join with a typed HQL query, so I also have the ability to deviate a little from the annotations and use it in there... any ideas?