When loading a collection, hibernate issues two identical selects. My mappings are:
The many to one mapping:
<many-to-one name="salesBundleData" class="com.po.model.appobjects.SalesBundleDataImpl" cascade="none" outer-join="auto" >
<column name="SALESBUNDLE_ID" not-null="true" unique-key="TIA_DATAUNSVD_UK1" />
</many-to-one>
The one to many mapping:
<map name="modifiedDataMap" lazy="false" inverse="true" cascade="all-delete-orphan" outer-join="true" >
<cache usage="read-write"/>
<key>
<column name="SALESBUNDLE_ID" />
</key>
<index column="DATA_KEY" type="string"/>
<one-to-many class="com.po.model.appobjects.ModifiableDataItem" />
</map>
Any ideas why two selects identical would be generated? Plus is there any way to avoid the collection being re-created, I'm caching it and this work ok, but the first time after it has been created re-initializes the collection.
Thanks Pete.
|