HI, i am trying to write an hql query with nested select statements, e.g, Select new Cat(id, name, color,........) from ( select cat.id as id, cat.color as color, cat.name as name, sum(case when sibs.color = 'Black' and sibs.Type = 'Male' then 1 else 0 end ) as BlackSibs , sum(case when sibs.color = 'White' and sibs.Type = 'Male' then 1 else 0 end ) as WhiteSibs from Cat cat join cat.siblings sibs ) where WhiteSibs >0 and BlackSibs >0
But i am unable to write in a way that works. Does HQL support nested select statements. Plz Help.
|