Hello,
Is it possible to use lazy association with composite-id and key-many-to-one?
I have read in Hibernate in action that this type of mapping is not recommended (page 336).
Please read the example given below.
Hibernate version 2.1.8
Database : Oracle 9.2
Mapping example :
<class name="User" table="USER">
<composite-id name="userId" class="UserId">
<key-property name="userName"column="USERNAME"/>
<key-many-to-one name="organization" class="Organization">
<column="ORGANIZATION_NAME"/>
<column="ORGANIZATION_STATE"/>
</key-many-to-one>
</composite-id>
<version name="version"
column="VERSION"
unsaved-value="0"/>
...
</class>
For each request on a user there is a request on the organization. I have put lazy="true" on the organization class tag.
Thanks for your help,
Bruno CHEVALIER
Project Manager
|