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.  [ 2 posts ] 
Author Message
 Post subject: Need a help on cascade
PostPosted: Mon Aug 16, 2010 2:33 pm 
Newbie

Joined: Mon Aug 16, 2010 2:13 pm
Posts: 1
Hi,
I'm having a domain object say "Product" and "Order". Each Order contains Products so, "product" domain object is property in "Order" domain object. Inorder to retrieve both order and its product in one call, I have enable Lazy-Loading = "True" and cascade enabled on mapping file.Because of this every time, I retrieve Order object,so its products get pulled up from database. My question is, is there any possiblity to load "Product"'s in Order domain object on demand basis. I.e when we i want to retrieve all orders, i dont want to populate "products" with respective order. In some cases we want to populate all orders with their repective "products". In their any possibility to populate on "need basis". Please let me know ASAP


Top
 Profile  
 
 Post subject: Re: Need a help on cascade
PostPosted: Wed Sep 01, 2010 12:51 pm 
Newbie

Joined: Wed Sep 01, 2010 11:22 am
Posts: 2
If the product is lazy-loaded, and still in a persistent state, then just accessing the product will result in it being retrieved by the session. If you wish to retrieve orders and products at the same time, they you should use a fetch statement when querying for the data.

_________________
Thanks,
Jeffrey Jochum


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