[Bug #622] Fix bug.

The problem lied in that it was checking checkConstraintUniqueCode
from IntegrationEntity and used IntegrationEntity code instead of the
code from OrderElement. So the method is overriden to bypass that
check.

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
Óscar González Fernández 2010-09-07 11:38:10 +02:00
parent b15359bb6b
commit 5087351eaf

View file

@ -48,7 +48,6 @@ import org.navalplanner.business.advance.exceptions.DuplicateValueTrueReportGlob
import org.navalplanner.business.common.IntegrationEntity;
import org.navalplanner.business.common.Registry;
import org.navalplanner.business.common.daos.IIntegrationEntityDAO;
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
import org.navalplanner.business.common.exceptions.ValidationException;
import org.navalplanner.business.labels.entities.Label;
import org.navalplanner.business.materials.entities.MaterialAssignment;
@ -983,6 +982,13 @@ public abstract class OrderElement extends IntegrationEntity implements
}
}
@Override
public boolean checkConstraintUniqueCode() {
// the automatic checking of this constraint is avoided because it uses
// the wrong code property
return true;
}
@AssertTrue(message = "a label can not be assigned twice in the same branch")
public boolean checkConstraintLabelNotRepeatedInTheSameBranch() {
return checkConstraintLabelNotRepeatedInTheSameBranch(new HashSet<Label>());