-->
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.  [ 1 post ] 
Author Message
 Post subject: 1-many relation mapping problem
PostPosted: Thu Jun 07, 2007 5:52 pm 
Newbie

Joined: Sun Oct 01, 2006 10:35 pm
Posts: 9
Irrespective of version of hibernate, I have this question on hibernate efficiency in 1-many OR mapping situations.

I have a situation where I have tables T1, T2, T3, T4, T5

T1 has 1-many relationship with T2
T2 has 1-many relationship with T3
T3 has 1-many relationship with T4
T4 has 1-many relationship with T5

I guess u got the picture!

Now I have classes C1, C2, C3, C4, C5 representing the corresponding tables and each 1-many uses with Set data type.

But, my problem is my business case only wants information about C1, and corresponding C5. So, hibernate loads all the entities belonging all 5 classes (tables) into memory (ofcourse hibernate has to navigate the tree path) so I can retrieve data for C1 and C5. Obviously if you use plain JDBC, you can write the same query but just what you want (C1 and C5 fields), which I think lot more efficient especially when database and app server are in different servers on the network.

is there any better way of mapping in this kind of relationships and business cases?

Thanks
R


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

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.