-->
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.  [ 4 posts ] 
Author Message
 Post subject: Fetch a single object without any child relations
PostPosted: Wed Jul 27, 2005 4:08 pm 
This may have been covered elsewhere, but I wasn't able to find it. I want to retrieve a single entity without any of its traversing the object graph. I already use the "left join fetch" qualifier for other queries, but in this case the only available relationship has a nasty graph of its own.

Is this possible?

Michael


Top
  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 5:02 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
I'm not sure if it is what you need but isn't it the "lazy initialization" ? ( by adding to your child collection mapping lazy="true" ) ?

http://nhibernate.sourceforge.net/h2.0.3-docs/reference/html/collections.html#collections-s1-7

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 11:48 am 
That's the other side of the relationship. This is the many side which doesn't have an explicit lazy-load option. I do have the virtual keyword applied to the property.

Michael


Top
  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:05 pm 
Regular
Regular

Joined: Tue May 24, 2005 12:55 pm
Posts: 56
If objA references objB which is mapped as lazy in the class node and you don't use Fetch in your HQL then objB shouldn't be returned as a result of the query. You can confirm this via the logs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.