-->
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: Hibernate using Dynamic Instantiation ... not working ....
PostPosted: Tue Mar 08, 2005 7:43 pm 
Regular
Regular

Joined: Fri Mar 04, 2005 1:33 pm
Posts: 65
Location: U.K.
Hi

I am using dynamic instatiation feature of Hibernate's projection query. I get Class not found exception. The class SearchResults is defined in another directory under same source tree. Appropriate import statement is also present. Can someone let me know how to resolve this ?

Where does Hibernate look to find definition of this class ? I assume in the classpath associated with the EAR file ?

Thanks
Ron

Hibernate version:
2.1
Mapping documents:

Code between sessionFactory.openSession() and session.close():
Session session = HibernateUtil.getSession();
StringBuffer qbuf = new StringBuffer();

qbuf.append(" select new SearchResults( a.name, a.state) ");
qbuf.append(" from A as a " );
qbuf.append(" order by a.name asc ");

Query query = session.createQuery( qbuf.toString() );
result = query.list();

Full stack trace of any exception that occurs:
WARNING: CORE3283: stderr: net.sf.hibernate.QueryException: class not found: SearchResults [ select new SearchResults( a.name, a.state) from A as a order by a.name asc ]

WARNING: CORE3283: stderr: at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:70)
WARNING: CORE3283: stderr: at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
WARNING: CORE3283: stderr: at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)

Name and version of the database you are using:
Oracle 9i


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 7:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use the full classname.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 9:26 pm 
Regular
Regular

Joined: Fri Mar 04, 2005 1:33 pm
Posts: 65
Location: U.K.
It is working now when I used a full class name.

Thank you.
Ron


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.