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
|
|