I've some problem with HQL query. I would use subquery with alias like this
select distinct a.some1, count(a.some2),
(Select count(z.any), z.any.any_id as v from Z z where
z.level=4) as "zoo", azc.a.any_id
from A a
where a.z.level=4
zoo.v=a.z.m
but alias return me a error. Where is the problem?