Hi All,
I'm trying to upgrade from hibernate-3.0.5 to hibernate-3.1.1 and my application's regression tests have caught a problem with lazily loaded many-to-one associations.
In Hibernate-3.0.5, I had the following mapping fragment.
Code:
<many-to-one name="customer" column="PRIMARY_KEY_COLUMN" unique="true" lazy="true" fetch="select" insert="false" update="false"/>
I *am* doing the necessary build-time instrumentation and with hibernate-3.0.5 "customer" is not loaded when loading the associated entity through an HQL query.
(The HQL query specifies no eager fetching of the customer association.)
For Hibernate-3.1.1, I applied the following change (i.e. lazy="true" --> lazy="no-proxy"):
Code:
<many-to-one name="customer" column="PRIMARY_KEY_COLUMN" unique="true" lazy="no-proxy" fetch="select" insert="false" update="false"/>
Now "customer" is always being loaded when executing the query.
Is this a hibernate bug?
Or perhaps was my previous usage wrong and only working by chance?
I don't suppose there is a regression test in the Hibernate test suite for many-to-one unique lazy associations that someone could point me to?
If not, I'd be glad to write up a simple test case to reproduce this behaviour.
Thanks!