I'm attempting to write an HQL statement that uses an inner select, but Hibernate's complaining about invalid syntax. I'm fairly certain I've got something wrong, but I can't find information about how to do an inner
select with HQL.
I'm attempting to select object a in two buckets - those with a b.name of 'FOO', and those with either no b record, or with b.name as anything else.
I'm interested in all a objects, and the b.name values of those that meet
the criteria.
I'd like to write something like so
Code:
from a
left outer join (select b.id, b.name, b.a_id
from b
where name = 'FOO') as b2
Hibernate says that the ( in 'left outer join (select' is incorrect.
Is this in the reference guide, or elsewhere? My google-fu is lacking today.
Thanks for your help.
- Mark