-->
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: Query.createQuery creates 2 selects instead of 1
PostPosted: Tue Feb 26, 2008 7:18 am 
Newbie

Joined: Tue Feb 26, 2008 6:46 am
Posts: 2
If I call Query.createQuery Hibernate creates 2 Select statements. The first one is the expected statement but its followed by a second statement that quite different from the origin. It contains a where condition that asks only for 1 id.

The query joins 3 tables which have a 1-n relation (bidirectional): table1 -- 1-n -- table2 -- 1-n -- table3. I used Annotations for configuration.

What could be the reason that a second select statement is created. Configuration ...?

Version: hibernate-3.2.6.ga


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 26, 2008 11:14 am 
Newbie

Joined: Wed Feb 13, 2008 10:35 am
Posts: 7
Probably because of the fetch mode you use or Hibernate's lazy loading. Please provide more information if the behaviour looks like a problem to you.

Sebastian


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.