java - HQL NullPointerException -
i have query writen in hql throwing nullpointerexception , can't see why. thrown more specific exception, related sql grammar.
select sum(coalesce(opt.qtvagasedital, 1)) - sum( (select count(b.id) bolsa b b.cotabolsaatual.id = cb.id , ( now() between b.datainicio , b.datafim ) , (b.idedital = opt.idedital )) ) oportunidadeestagio opt opt.cotabolsa.id = cb.id , (opt.registroinativacao.id null)
idedital can null in both bolsa , oportunidadeestagio, when convert query sql using postgres works fine.
the nullpointer thrown in
query query = getsession().createquery(queryhql);
stacktrace:
caused by: java.lang.nullpointerexception @ org.hibernate.dialect.dialect$3.getreturntype(dialect.java:102) @ org.hibernate.hql.ast.util.sessionfactoryhelper.findfunctionreturntype(sessionfactoryhelper.java:382) @ org.hibernate.hql.ast.tree.aggregatenode.getdatatype(aggregatenode.java:21) @ org.hibernate.hql.ast.tree.binaryarithmeticoperatornode.initialize(binaryarithmeticoperatornode.java:29) @ org.hibernate.hql.ast.hqlsqlwalker.preparearithmeticoperator(hqlsqlwalker.java:1011) @ org.hibernate.hql.antlr.hqlsqlbasewalker.arithmeticexpr(hqlsqlbasewalker.java:2756) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectexpr(hqlsqlbasewalker.java:2006) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectexprlist(hqlsqlbasewalker.java:1825) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectclause(hqlsqlbasewalker.java:1394) @ org.hibernate.hql.antlr.hqlsqlbasewalker.query(hqlsqlbasewalker.java:553) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectexpr(hqlsqlbasewalker.java:2014) @ org.hibernate.hql.antlr.hqlsqlbasewalker.aliasedselectexpr(hqlsqlbasewalker.java:2057) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectexprlist(hqlsqlbasewalker.java:1832) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectclause(hqlsqlbasewalker.java:1394) @ org.hibernate.hql.antlr.hqlsqlbasewalker.query(hqlsqlbasewalker.java:553) @ org.hibernate.hql.antlr.hqlsqlbasewalker.selectstatement(hqlsqlbasewalker.java:281) @ org.hibernate.hql.antlr.hqlsqlbasewalker.statement(hqlsqlbasewalker.java:229) @ org.hibernate.hql.ast.querytranslatorimpl.analyze(querytranslatorimpl.java:228) @ org.hibernate.hql.ast.querytranslatorimpl.docompile(querytranslatorimpl.java:160) @ org.hibernate.hql.ast.querytranslatorimpl.compile(querytranslatorimpl.java:111) @ org.hibernate.engine.query.hqlqueryplan.<init>(hqlqueryplan.java:77) @ org.hibernate.engine.query.hqlqueryplan.<init>(hqlqueryplan.java:56) @ org.hibernate.engine.query.queryplancache.gethqlqueryplan(queryplancache.java:72) @ org.hibernate.impl.abstractsessionimpl.gethqlqueryplan(abstractsessionimpl.java:133) @ org.hibernate.impl.abstractsessionimpl.createquery(abstractsessionimpl.java:112) @ org.hibernate.impl.sessionimpl.createquery(sessionimpl.java:1623)
Comments
Post a Comment