-->
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.  [ 5 posts ] 
Author Message
 Post subject: Forcing inner join without HQL
PostPosted: Tue May 03, 2005 3:28 pm 
Newbie

Joined: Tue May 03, 2005 3:10 pm
Posts: 2
Hello,

I must use Criteria and due to performance reasons I need to have `inner join' instead of `left join' in generated SQL.

Mapping is classic many-to-one.

When I use `fetch="join"' I get left join in generated SQL (which is significantly slower than inner join in that specific query)
When I use `fetch="select"' I get 100s of unwanted additional queries

To sum it up: The generated sql will be perfectly ok after s/left join/inner join/

I will be thankful for any help..

Jan Havelka

Im using hibernate 3.0 final, this problem is not database specific..


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 9:03 am 
Newbie

Joined: Tue Apr 26, 2005 3:06 pm
Posts: 14
Location: Vitória - ES - Brasil
i need get left join only but hibernate returns my left join and automatic inner join.

_________________
Roberto Marconi


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 10:26 am 
Newbie

Joined: Tue May 03, 2005 3:10 pm
Posts: 2
Hello,

bejeto wrote:
i need get left join only but hibernate returns my left join and automatic inner join.



any details? What hibernate version are you using and what are your attributes in mapping (probably many-to-one)?
Im not able to have inner join in final SQL query without HQL...


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 8:39 am 
Newbie

Joined: Tue Apr 26, 2005 3:06 pm
Posts: 14
Location: Vitória - ES - Brasil
Hibernate version: 2.1.8

Yes, I need make 3 outer joins with many-to-one but Hibernate don´t undestand and return SQL with my outer join and automatic inner join.

I have any entities with more then 8 relationships. Each relationship have others relationships. When i using hibernate metohd get() by ID, hibernate need many queries for return my entity. To decide this problem, i use hibernate method find(HQL) in following format:

select A.Id, A.Name, A.CelPhone, A.B.Id, A.B.Description where A, B where A.B.Id = B.Id(+)

I testing .....where left outer join A.B.Id and ....from A left outer join B but had not results different.

_________________
Roberto Marconi


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 8:44 am 
Newbie

Joined: Tue Apr 26, 2005 3:06 pm
Posts: 14
Location: Vitória - ES - Brasil
I have SOME entities with more then 8 relationships, not all!

lol

My english is bad!

_________________
Roberto Marconi


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