Fix LazyInitializationException when sorting project list by Total Budget

Total Budget sorter uses a number of collections that are being lazy loaded, changed to load eagerly.
Possibly could use a *forceLoad* method but dont see any available publicly. May need to revisit
for performance reasons at some point.
This commit is contained in:
lmann99 2017-01-08 00:24:39 -05:00
parent b5d13c0824
commit 21c41a4e35
2 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,7 @@
</set>
<!-- Indexed the other side -->
<set name="criterionRequirements" access="field" cascade="all,delete-orphan" inverse="true" batch-size="10">
<set name="criterionRequirements" access="field" cascade="all,delete-orphan" inverse="true" batch-size="10" lazy="false">
<key column="order_element_id" not-null="false"/>
<one-to-many class="org.libreplan.business.requirements.entities.CriterionRequirement"/>
</set>
@ -86,7 +86,7 @@
<key column="order_element_id"/>
<!-- Indexed the other side -->
<list name="children" access="field" cascade="all">
<list name="children" access="field" cascade="all" lazy="false">
<key column="parent" not-null="false"/>
<index column="position_in_container"/>
<one-to-many class="OrderElement" />
@ -216,7 +216,7 @@
<property name="fixedPercentage" column="fixed_percentage" access="field" />
<!-- Indexed the other side -->
<set name="criterionRequirements" access="field" cascade="save-update,delete-orphan" inverse="true" batch-size="10">
<set name="criterionRequirements" access="field" cascade="save-update,delete-orphan" inverse="true" batch-size="10" lazy="false">
<key column="hours_group_id" not-null="false"/>
<one-to-many class="org.libreplan.business.requirements.entities.CriterionRequirement"/>
</set>

View file

@ -35,7 +35,7 @@
<!-- Inverse navigation from CriterionRequirement to Criterion -->
<!-- Not indexed. Other side navigation not useful -->
<many-to-one class="org.libreplan.business.resources.entities.Criterion" column="criterion_id"
name="criterion"/>
name="criterion" lazy="false"/>
<subclass discriminator-value="direct" name="DirectCriterionRequirement">
<set access="field" name="children" cascade="delete-orphan" inverse="true" batch-size="10">