-->
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: ManyTables/Joins - Toplink vs. Hibernate
PostPosted: Sat Apr 24, 2004 4:07 am 
Beginner
Beginner

Joined: Mon Nov 24, 2003 11:47 am
Posts: 22
When I use Hibernate, than generated SQL is too huge. Hibernate generate SQL command with joins all associated objects:

select .... from obejct1 left outer join object2 ... left outer join object3

I am not able to avoid this behaviour, becasue I can mark only collections (many-to-one) as lazy, but not objects (one-to-many).

On the contrary Toplink generate more sql commands:

select ... from object1
select ... from object2
select ... from object3

I think that Toplink behaviour is better becasue:

1. if I have object2,object3 in cache I cannot must load it.

2. Our company have account aplication where is a lot of objects (>100). We have developed query system, where I can filter Hibernate ojects (I use Criteria API). We have case, when user use a lot of filter conditions. SQL command generated by Hibernate throws SQLException (on MySQL) because there was more than 31 tables in select (MySQL has this limit).


Is there posibility to change behaviour of generated SQL commands ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 4:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Code:
<many-to-one outer-join="false"/>


Please read the documentation before posting in the forum. TIA


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 4:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Oh, actually, I think what you are actually asking for is:

Code:
<class lazy="true">


Go read the whole ref manual.


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.