I have 2 Beans with a many-to-one association connecting them: an Order and a Customer.
Both Beans are configured with lazy loading = false.
The Association is configured with lazy loading = proxy.
Code:
<hibernate-mapping>
<class lazy="false" name="Order" table="Salesorder" optimistic-lock="version">
...
<many-to-one name="customer"
class="Customer"
column="customer_id"
not-null="true"
lazy="proxy"/>
...
Code:
<hibernate-mapping>
<class lazy="false" name="Customer" table="Customer" optimistic-lock="version">
...
In this scenario Hibernate ignores the lazy configuration for the association while loading an Order: the Customer record is fetched eagerly.
The lazy configuration for the Bean seems to override the lazy configuration for the association.
Is this assumption true? I didn't find a hint in the documentation.
Can I change this behaviour?
Greetings,
Takashi