Fix bug LazyInitializationException on saving limiting resources
FEA: ItEr65OTS04CorreccionsRecursosLimitantes
This commit is contained in:
parent
2f2ebb8f86
commit
3794fc60c6
1 changed files with 5 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.common.daos.GenericDAOHibernate;
|
||||
|
|
@ -100,7 +101,10 @@ public class TaskElementDAO extends GenericDAOHibernate<TaskElement, Long>
|
|||
}
|
||||
|
||||
private void updateSumOfAllocatedHoursToParent(TaskGroup taskGroup, Integer differenceOfHours) {
|
||||
if(taskGroup != null) {
|
||||
if (taskGroup != null) {
|
||||
if (!Hibernate.isInitialized(taskGroup)) {
|
||||
reattach(taskGroup);
|
||||
}
|
||||
taskGroup.addSumOfHoursAllocated(differenceOfHours);
|
||||
updateSumOfAllocatedHoursToParent(taskGroup.getParent(), differenceOfHours);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue