A 'Umfrage' contains a Set of 'fragen', which is lazy.
Code:
<hibernate-mapping package="de.fhzw.portal.umfragesystem.model.domainmodel.umfrage">
<class name="Umfrage" lazy="true" dynamic-insert="true" dynamic-update="true">
<id name="id" unsaved-value="0">
<generator class="increment" />
</id>
<property name="umfrTyp" column="UMFR_TYP" not-null="true" />
<property name="fragenAufteilung" column="FRAGEN_AUFTEILUNG"
not-null="true" />
<property name="bearbZeit" column="BEARB_ZEIT" />
<property name="fragebogenLayout" column="FRAGEBOGEN_LAYOUT"
not-null="true" />
<property name="layoutFile" column="FRAGEBOGEN_LAYOUT_FILE" />
<property name="autor" not-null="true" />
<property name="autorName" column="AUTOR_NAME" />
<property name="maxSeitenzahl" column="MAX_SEITENZAHL" not-null="true" />
<set name="fragen" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="FRAGE_UMFRAGE" />
<one-to-many class="Frage" />
</set>
</class>
</hibernate-mapping>
A Frage contains a Set of 'antworten', which is non-lazy.
Code:
<hibernate-mapping
package="de.fhzw.portal.umfragesystem.model.domainmodel.umfrage">
<class name="Frage" lazy="true" dynamic-insert="true" dynamic-update="true">
<id name="id" unsaved-value="0">
<generator class="increment" />
</id>
<property name="fragetext" />
<property name="typ" not-null="true" />
<property name="index" column="FRAGEINDEX" not-null="true" />
<property name="anmerkfeld" not-null="true" />
<property name="mussFrage" column="IST_MUSS_FRAGE" not-null="true" />
<property name="seitenzahl" not-null="true" />
<many-to-one name="umfrage" column="FRAGE_UMFRAGE" class="Umfrage"
cascade="none" />
<many-to-one name="zf" column="FRAGE_ZUSGESFRAGE"
class="Zusammengesetztefrage" cascade="none" />
<set name="antworten" lazy="false" inverse="true"
cascade="all-delete-orphan">
<key column="FRAGE_ANTWORT" />
<one-to-many class="Antwort" />
</set>
</class>
</hibernate-mapping>
The problem is that the 'fragen' collections and the 'antworten' collections are loaded, although the 'fragen' collection is lazy, and I do not query a 'Frage' or a 'Antwort'.
Is it possible that all that stuff has to be loaded, because the 'antworten' are non-lazy? I thought they would only have to be loaded when the 'fragen' are explicitely loaded.