[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - IllegalArgumentException when using Constructor expression i

sofiatan do-not-reply at jboss.com
Wed Feb 7 08:10:01 EST 2007


I have the following JPQL-query: 

SELECT new se.callista.test.dto.EmployeeReportData(e.firstName, e.lastName, a.city, e.employmentPeriod.startDate) FROM Employee e JOIN e.address a ORDER BY e.lastName, e.firstName
  | 

where EmployeeReportData is a dto (not an entity). The query works fine when running it as a normal query. When I put it as a named query however, I get the following error message when trying to execute it:  java.lang.IllegalArgumentException: Not an entity:class se.callista.test.dto.EmployeeReportData

I can't find anything in the JPA-spec that says a named query cannot contain a constructor expression - am I missing something? 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012403#4012403

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012403



More information about the jboss-user mailing list