-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Subselect in the projection, does it works?
PostPosted: Wed Oct 12, 2005 11:01 am 
Newbie

Joined: Wed Oct 12, 2005 10:50 am
Posts: 4
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.