ItEr38S05ValidacionEProbasFuncionaisItEr37S06: [Bug #120] Changing the implementation of initEdit to correct the bug

This commit is contained in:
Jacobo Aragunde Pérez 2009-12-08 12:50:36 +01:00 committed by Javier Moran Rua
parent 92899ccbe7
commit e7f13dfe39

View file

@ -22,6 +22,7 @@ package org.navalplanner.web.costcategories;
import java.util.List;
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
import org.navalplanner.business.common.exceptions.ValidationException;
import org.navalplanner.business.costcategories.daos.ITypeOfWorkHoursDAO;
import org.navalplanner.business.costcategories.entities.TypeOfWorkHours;
@ -71,7 +72,12 @@ public class TypeOfWorkHoursModel implements ITypeOfWorkHoursModel {
@Override
@Transactional(readOnly = true)
public void initEdit(TypeOfWorkHours typeOfWorkHours) {
this.typeOfWorkHours = typeOfWorkHours;
try {
this.typeOfWorkHours = typeOfWorkHoursDAO.find(typeOfWorkHours.getId());
}
catch(InstanceNotFoundException e) {
initCreate();
}
}
}