pmularien wrote:
... except that you can't use the fetch attribute in Hibernate 2.x because it doesn't exist. Try the outer-join attribute instead.
I have tried to use outer-fetch but it is still generating one sql for each one-to-many relationship. I am wondering if I haven't used the outer-fetch properties correctly. I am MS-SQL 2000.
I have added the following line in the hibernate.properties
hibernate.max_fetch_depth=2
The xml file:
<bag
name="productPackagings"
lazy="true"
inverse="true"
cascade="delete"
outer-join="true"
>
<key>
<column name="product_id" />
</key>
<one-to-many
class="erp.dataaccesslayer.hibernate.dataobjects.ProductPackaging"
/>
</bag>
I have tried to put the outer-join="true" in the <one-to-many> like the following:
<bag
name="productPackagings"
lazy="true"
inverse="true"
cascade="delete"
>
<key>
<column name="product_id" />
</key>
<one-to-many
class="erp.dataaccesslayer.hibernate.dataobjects.ProductPackaging" outer-join="true"
/>
</bag>
But I have exception when the Hibernate initialises telling there is no such properties defined.
Thanks a lot!
Best regards
Edmond