Hibernate version:3.1.3
Name and version of the database you are using:Oracle 10g
I use a one-to-many association and I have got problem with lazy mode because the collection is loaded when I search for parents items. When I look for SQL queries, there is one query for parents and one for each result. I don't want to use fetch mode, I don't want the collection to be loaded.
When I look in source code, there is a "some collections are not lazy" in CollectionType class. Am I in this case ?
Thanks for help.
Here is my parent class mapping file :
<class name="Archive" table="T_ARCHIVE" mutable="true" dynamic-update="false" dynamic-insert="false" select-before-update="false" abstract="false">
...
<bag name="events" lazy="true">
<key on-delete="noaction" unique="false" not-null="true">
<column name="ARC_ID_ARCHIVE" sql-type="NUMBER(10)" not-null="true" length="10"/>
</key>
<one-to-many class="com.archive.model.ArchiveEvent"/>
</bag>
Her is my child class mapping file :
<class name="ArchiveEvent" table="T_ARCHIVE_EVENT" mutable="true" dynamic-update="false" dynamic-insert="false" select-before-update="false" abstract="false">
...
<many-to-one name="archive" class="com.archive.model.Archive" outer-join="false" update="false" insert="false">
<column name="ARC_ID_ARCHIVE" sql-type="NUMBER(10)" not-null="true" length="10"/>
</many-to-one>
|