-->
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.  [ 3 posts ] 
Author Message
 Post subject: net.sf.hibernate.QueryException: dereferenced
PostPosted: Sat Jun 26, 2004 11:00 am 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
hi
i'm using this code:
Code:
"select elements(turma.q5) from Turma turma";

and get this error:
Quote:
net.sf.hibernate.QueryException: dereferenced: turma0_.q5.elements [select elements(turma.q5) from escola.Turma turma]
at net.sf.hibernate.hql.PathExpressionParser.token(PathExpressionParser.java:140)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:154)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1554)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1525)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1513)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1505)
at escola.TesteComVisual.listaEpocas(TesteComVisual.java:135)
at escola.TesteVisual.lmEpocas(TesteVisual.java:17)
at escola.TesteVisual.<init>(TesteVisual.java:43)
at escola.teste.<init>(teste.java:11)
at escola.teste.main(teste.java:41)

I'm using hibernate 2.1 with MySql 2.0.12-nt.
I simply want to get all values from column q5 from Turma table.
Turma bellongs to Relatorio, and this one bellongs toUtilizador
Voil


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 26, 2004 10:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
q5 is a simple property and not a collection so

Code:
"select turma.q5 from Turma turma";


will do.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 27, 2004 7:13 am 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
thank you


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.