Fix NonUniqueObjectException on the project gantt when loading the same criteria of the user filter setting

Due to the relationship between user and criteria not being lazy, the reattach method was
bringing an already loaded element.

FEA: ItEr77S04BugFixing
This commit is contained in:
Lorenzo Tilve Álvaro 2013-03-27 08:57:34 +01:00
parent 95c044afee
commit 82f2591ab0

View file

@ -909,7 +909,9 @@ public class PlanningStateCreator {
private void reattachCriterions(Set<Criterion> criterions) {
for (Criterion each : criterions) {
criterionDAO.reattachUnmodifiedEntity(each);
if (!Hibernate.isInitialized(each)) {
criterionDAO.reattachUnmodifiedEntity(each);
}
}
}