This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Using fetch all properties on Hibernate Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Using fetch all properties on Hibernate Query" Watch "Using fetch all properties on Hibernate Query" New topic
Author

Using fetch all properties on Hibernate Query

Sergio Silva
Greenhorn

Joined: May 03, 2006
Posts: 5
I'm trying to write a generic method that receives as argument a class and his primary key, and constructs a Select with fetch all properties.

I'm testing this with a simple example.

I have an entity AdmLanguage that have a OneToMany (with FetchType. LAZY) relationship with a entity AdmResources.

I'm writing the query:

SELECT t FROM AdmLanguage t FETCH ALL PROPERTIES WHERE t.languageid = 1


I'm getting the result query:

select admlanguag0_.languageId as languageId12_, admlanguag0_.description as descript2_12_, admlanguag0_.languageCode as language3_12_
from ADM_Language admlanguag0_
where admlanguag0_.languageId=1


Shouldn't this "Fetch All properties" take all the resources associated to the language either?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Using fetch all properties on Hibernate Query
 
It's not a secret anymore!