-->
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: Where condition mistreated
PostPosted: Wed Jan 05, 2005 5:50 am 
Newbie

Joined: Tue Dec 21, 2004 10:53 am
Posts: 8
Location: Stuttgart/Germany
Hi,
i have a question on the following behavoiur:
if i set in the mapping of the set auto-join to true, the where condition is not added to teh generated sql.
if i set this to auto or false it is executed correctly, also if lazy is set to true.
it seems, that outer joins to not include where clauses of a set.
is this intended behaviour or not?

Hibernate version: 2.1.7c

Mapping documents:
<set name="orderLineItems"
table="OrderLineItem"
lazy="false"
inverse="true"
cascade="save-update"
where="del = 0"
outer-join="true"

>
<key
column="Order_ID"
/>

<one-to-many
class="com.meagle.bo.OrderLineItem"

/>
</set>


The generated SQL (show_sql=true):
Hibernate: select order0_.Order_ID as Order_ID1_, order0_.UserName as UserName1_, order0_.Total as Total1_, orderlinei1_.Order_ID as Order_ID__, orderlinei1_.OrderLineItem_ID as OrderLin1___, orderlinei1_.OrderLineItem_ID as OrderLin1_0_, orderlinei1_.Order_ID as Order_ID0_, orderlinei1_.Description as Descript3_0_, orderlinei1_.LineItemPrice as LineItem4_0_, orderlinei1_.del as del0_ from Orders order0_ left outer join OrderLineItem orderlinei1_ on order0_.Order_ID=orderlinei1_.Order_ID where order0_.Order_ID=?


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.