Hi all,
I'm quite new in the hql world and I'm trying to do a subselect in the projection but it doesnt work! I want to know if it's possible. Example:
Code:
SELECT (SELECT te2.nrDdi FROM TelefoneEndereco te2) as teste
FROM com.mercurio.lms.configuracoes.model.TelefoneEndereco te
WHERE te.enderecoPessoa = ?
This code give me this error:
15:00:37,639 INFO [STDOUT] Caused by: java.lang.NullPointerException
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.aliasedSelectExpr(HqlSqlBaseWalker.java:1703)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1474)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1041)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:380)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
15:00:37,639 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
15:00:37,686 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
15:00:37,686 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
15:00:37,686 INFO [STDOUT] at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
15:00:37,686 INFO [STDOUT] at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
15:00:37,686 INFO [STDOUT] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
15:00:37,686 INFO [STDOUT] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
Anyone has an idea about this?
Thanks!