diff --git a/src/main/java/info/bukova/isspst/data/Requirement.java b/src/main/java/info/bukova/isspst/data/Requirement.java index 36edec15..661cfed7 100644 --- a/src/main/java/info/bukova/isspst/data/Requirement.java +++ b/src/main/java/info/bukova/isspst/data/Requirement.java @@ -16,7 +16,7 @@ import javax.persistence.Table; @Table(name = "REQUIREMENT") public class Requirement extends RequirementBase { - @OneToMany(fetch = FetchType.EAGER, mappedBy = "requirement", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(fetch = FetchType.LAZY, mappedBy = "requirement", cascade = CascadeType.ALL, orphanRemoval = true) private List items; @Column(name = "DELIVERYDATE") diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java index 61c91e6e..bb15c84d 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementService.java @@ -9,6 +9,8 @@ import java.util.List; public interface RequirementService extends RequirementBaseService { public void loadGroups(Requirement req); + + public void loadItems(Requirement req); public BigDecimal calcTotalFromItem(RequirementItem item); diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java index 542e375f..1a0df9cd 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementServiceImpl.java @@ -14,6 +14,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; +import org.hibernate.Hibernate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @@ -135,6 +136,19 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl