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=?
|