File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes JPA and static inner class, possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA and static inner class, possible?" Watch "JPA and static inner class, possible?" New topic
Author

JPA and static inner class, possible?

Caine Lai
Greenhorn

Joined: Sep 21, 2005
Posts: 15
Maybe someone has an idea how to do this. I want to collect some statistics using JPA and return them all as a value object to my web tier.

In my value object I have a static inner class I would like to use for the JPA query. Is this possible?

My Class:


And here is the method I am trying to execute:


The error:
org.hibernate.hql.ast.QuerySyntaxException: Unable to locate class [vo.stats.vendor.GeneralVendorStatsVO.StatusCounts]

I don't know why this would not work, when I can do:


Any ideas? Thanks!


Online collaboration made simple: <a href="http://www.rallypointhq.com" target="_blank" rel="nofollow">http://www.rallypointhq.com</a>
Caine Lai
Greenhorn

Joined: Sep 21, 2005
Posts: 15
So to get around this issue I have resorted to having to do this:


Please tell me there is a better way...?

Thanks.
Emmanuel Bernard
author
Ranch Hand

Joined: Oct 22, 2008
Posts: 62
Open a JIRA issue on our website. Looks like a bug.
Caine Lai
Greenhorn

Joined: Sep 21, 2005
Posts: 15
Issue logged: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3655
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPA and static inner class, possible?
 
Similar Threads
Sort array - by two fields
rich:picklist and converter not displaying results
List not refreshing after submit
Associated objects in Hibernate findByExample is not working for associated objects s
Problem with jsp:getProperty