-->
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.  [ 4 posts ] 
Author Message
 Post subject: custom ItemRow class, pg 271 Hibernate in Action
PostPosted: Tue Oct 26, 2004 5:58 pm 
Newbie

Joined: Thu Sep 16, 2004 4:35 pm
Posts: 6
On page 271, in the section on writing report queries, there is an example of using dynamic instantiation.

The text states "The custom ItemRow doesn't have to be a persistent class; it doesn't have to be mapped or even known to Hibernate".

I have a class written to encapsulate a portion of a table that I need for reporting. It is not mapped to the database, and it is not known to the hibernate configuration.

When I deploy, I get this exception:
17:49:25,905 DEBUG [SessionImpl] find: select new ChannelLink(channel.id, channe
l.name) from Channel channel
17:49:25,905 DEBUG [QueryParameters] named parameters: {}
17:49:25,952 DEBUG [QueryTranslator] compiling query
17:49:26,030 ERROR [STDERR] net.sf.hibernate.QueryException: class not found: Ch
annelLink [select new ChannelLink(channel.id, channel.name) from com.px.ecm.doma
in.Channel channel ]
at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:70)

The ChannelLink class is in the jar file, in the ear, where it should be. The class is imported in the EJB that is calling the hibernate query. So why is the class not found?

Michel Brudzinski
mbrudzinski@yahoo.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 6:00 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Use a full qualified class name, of course.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 6:18 pm 
Newbie

Joined: Thu Sep 16, 2004 4:35 pm
Posts: 6
Yes, of course, it is always the little things that get me. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 6:24 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
And while you are at it, don't forget to post your review of the book to our Amazon page ;)

http://www.amazon.com/exec/obidos/tg/de ... 193239415X

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.