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