I'm new to both this board and Hibernate and wanted to know how I can mimic the following type of query in either HQL or using an instance of DetachedCriteria:
Select a.field1, b.field2
From TableA a, TableB b, TableC c
Where someCriteria = otherCriteria
And b.idField In( select max(idField) from TableB b1 where b1.theField = b.theField and b1.anotherField = b.anotherField )
Basically, in my Java code I have an instance of what represent TableB b, but am not sure if I can reference it inside the subquery, or whether I need to list both instances in the same subquery. I did try and search the forum, but did not find what I was looking for. So any help with this would be appreciated.
Thanks
|