-->
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.  [ 2 posts ] 
Author Message
 Post subject: HQL query giving dereferenced exception
PostPosted: Mon Jun 07, 2004 9:26 am 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
I have latest hibernate and perform the following query

select c.action.name
from CoverSheetItem c

and get this exception
Code:
net.sf.hibernate.QueryException: dereferenced: coversheet0_.action.name [select c.action.name
from com.lab.model.coversheet.CoverSheetItem c]
   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:170)
   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:1561)
   at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1532)
   at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)


The action is a PersistentEnum property of coverSheetItem. No other properties are mapped.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 07, 2004 10:39 am 
Regular
Regular

Joined: Thu Aug 28, 2003 10:54 am
Posts: 67
Doh! stupid me, of course name is _not_ mapped as its not a persistent property. I need a holiday.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.