From 5087351eaf64412dcc09aec3341d3405407ff1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Tue, 7 Sep 2010 11:38:10 +0200 Subject: [PATCH] [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 --- .../business/orders/entities/OrderElement.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/orders/entities/OrderElement.java b/navalplanner-business/src/main/java/org/navalplanner/business/orders/entities/OrderElement.java index f37626a59..653df1717 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/orders/entities/OrderElement.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/orders/entities/OrderElement.java @@ -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