Hi,
I am looking for a way to sort a resultset by an attribute of a subclass in HQL
The SQL query looks like (in fact it is much more complex than that; I don't intend to use plain SQL):
Code:
select * from account ac
left join form fo on ac.id = form.accountId
left join specificForm sf on fo.id = sf.id
order by sf.rate
I am unable to produce a working HQL query.
Code:
from Account ac
left join fetch ac.forms fo
order by fo.??
The tables look like this:
ACCOUNT:
id
FORM:
id
accountId
SPECIFICFORM: (this table is mapped as a joined-subclass of Form)
id (same as form.id)
rate
type
Thanks in advance for your help.
Pierre
Hibernate version: 3.1.3 & 3.2.0.ga