-->
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: Basic Question about Contained Classes
PostPosted: Sat Oct 07, 2006 4:58 pm 
Newbie

Joined: Sat Oct 07, 2006 4:44 pm
Posts: 4
Hello everyone this might be a very basic question, but I couldn't figure out and need some help.

Lets take an OrderEntry System.
Tables are Orders, OrderDetails, Products, Categories, Manufacturers, Customers

Order class has OrderDetails collection and all my collections are lazyly loaded and we dont have to discuss it here.

Class Hierarchy
OrderDetail has Order, Product
Product has Category, Manufacturer(for simplicity lets assume product to category is one to one)
Manufacturer has X, Y and Z

So when I load OrderDetail object it loads Order, Product, Category, Manufacturer, X, Y and Z.

I am only interested in OrderDetail Object and maybe Product and Order but definetly not the contained classes in Product and Order.

Is this a normal behaviour? If not what am I doing wrong? How can I fix this. I am using criteria API to retrieve OrderDetail Object.

Thanks Gurus
Binnyg


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 2:41 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Quote:
I am only interested in OrderDetail Object and maybe Product and Order but definetly not the contained classes in Product and Order.


Which version of Hibernate are you using? If it's Hibernate3.x, then you can make the objects in the Product and Order to be lazy, by specifying lazy=true on these associations. Look at the Hibernate3.0 dtd at:

http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd

for this lazy attribute.


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.