Hi,
While insert on select i am getting below error.
Exception in thread "main" org.hibernate.QueryException: could not resolve property: of: xxx at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44) at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1375) at org.hibernate.hql.ast.tree.IntoClause.isSuperclassProperty(IntoClause.java:184) at org.hibernate.hql.ast.tree.IntoClause.visitPropertySpecNodes(IntoClause.java:143) at org.hibernate.hql.ast.tree.IntoClause.visitPropertySpecNodes(IntoClause.java:162) at org.hibernate.hql.ast.tree.IntoClause.initializeColumns(IntoClause.java:125) at org.hibernate.hql.ast.tree.IntoClause.initialize(IntoClause.java:37) at org.hibernate.hql.ast.HqlSqlWalker.createIntoClause(HqlSqlWalker.java:945) at org.hibernate.hql.antlr.HqlSqlBaseWalker.intoClause(HqlSqlBaseWalker.java:839) at org.hibernate.hql.antlr.HqlSqlBaseWalker.insertStatement(HqlSqlBaseWalker.java:479) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:253) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) 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)
The query is shown below.
insert into xxx(dte, Id,f1,f2,f3,f4,f5,f10,f11,cnt) select dte, Id,f1,f2,f3,f4,f5,f10, round(sum(f11*cnt)/sum(cnt),2), sum(cnt) FROM yyy WHERE dte >= ? and dte <= ? and Id = ? group by dte,f1,f2,f3,f4,f5,f10
Please let me know is there any issue in the query. The select statement will return multiple records.
Thanks in Advance.
Regards, Purushotham Podaralla.
_________________ Purushotham Podaralla
|