Hibernate Criteria and Count Column

I am trying to return an entity with a column that has the count of another table that is a one to many relation. I want to do this using hibernate criteria, not HQL.

select p.*, (select count(*) from child where child.parentid = p.id) as LEVELS
from parent p
8
задан Mike Flynn 19 February 2011 в 19:28
поделиться