-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Using fetch all properties on Query
PostPosted: Tue Oct 30, 2007 6:18 am 
Newbie

Joined: Sat Oct 13, 2007 12:42 pm
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 11:50 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
no you need to explicitly use fetch join for collection and associations. From a definition point of view they are not considered proeprties

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 11:59 am 
Newbie

Joined: Sat Oct 13, 2007 12:42 pm
Posts: 5
Thanks,

I will use fetch join explicity.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.