Hi all. i'm trying to run following HQL query:
Code:
select new fully.quallifyed.name.MyBean(a.property1.property2.property3.property4, count(a.propertyA))
from Table a
where a.propertyB is null <!-- 2M -->
and a.propertyC.propertyC1.class = MyBean2 <!-- particular -->
and not a.propertyD
and a.propertyE.propertyA is null
and a.propertyE.propertyB is null
and a.propertyE.propertyC is null
and a.propertyE.propertyD is null
group by a.property1.property2.property3.property4 <!-- Group by first value of tuple returned -->
And I'm getting the followinng error:
Code:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: . near line 5, column 34 [select new fully.quallifyed.name.MyBean(a.property1.property2.property3.property4, count(a.propertyA))
from Table a
where a.propertyB is null <!-- 2M -->
and a.propertyC.propertyC1.class = MyBean2 <!-- particular -->
and not a.propertyD
and a.propertyE.propertyA is null
and a.propertyE.propertyB is null
and a.propertyE.propertyC is null
and a.propertyE.propertyD is null
group by a.property1.property2.property3.property4
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:235)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.genaros.commons.dao.hibernate.support.query.CustomQueryCallback.doInHibernate(CustomQueryCallback.java:184)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
... 21 more
Anybody knows if there is a syntax error?
MyBean class is BEAN complain, so has public empty constructor, public not empty constructor (a.property1.property2.property3.property4, long) and public getter, stter methods for all fileds.