diff --git a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponent.java b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponent.java
index fe23533ae..2fd1cf33c 100644
--- a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponent.java
+++ b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponent.java
@@ -27,8 +27,6 @@ import org.hibernate.validator.NotEmpty;
*/
public class InfoComponent {
- private String code;
-
private String name;
private String description;
@@ -36,15 +34,6 @@ public class InfoComponent {
public InfoComponent() {
}
- public void setCode(String code) {
- this.code = code;
- }
-
- @NotEmpty(message = "code not specified")
- public String getCode() {
- return code;
- }
-
public void setName(String name) {
this.name = name;
}
@@ -64,7 +53,6 @@ public class InfoComponent {
public InfoComponent copy() {
InfoComponent result = new InfoComponent();
- result.setCode(getCode());
result.setName(getName());
result.setDescription(getDescription());
return result;
diff --git a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponentWithCode.java b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponentWithCode.java
new file mode 100644
index 000000000..a1d313821
--- /dev/null
+++ b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/InfoComponentWithCode.java
@@ -0,0 +1,47 @@
+/*
+ * This file is part of LibrePlan
+ *
+ * Copyright (C) 2012 Igalia, S.L.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+package org.libreplan.business.orders.entities;
+
+import org.hibernate.validator.NotEmpty;
+
+/**
+ * @author Jacobo Aragunde Pérez
+ */
+public class InfoComponentWithCode extends InfoComponent {
+
+ private String code;
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ @NotEmpty(message = "code not specified")
+ public String getCode() {
+ return code;
+ }
+
+ public InfoComponentWithCode copy() {
+ InfoComponentWithCode result = new InfoComponentWithCode();
+ result.setCode(getCode());
+ result.setName(getName());
+ result.setDescription(getDescription());
+ return result;
+ }
+
+}
diff --git a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderElement.java b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderElement.java
index e9bfa7e53..d289376bf 100644
--- a/libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderElement.java
+++ b/libreplan-business/src/main/java/org/libreplan/business/orders/entities/OrderElement.java
@@ -75,7 +75,7 @@ import org.libreplan.business.workreports.entities.WorkReportLine;
public abstract class OrderElement extends IntegrationEntity implements
ICriterionRequirable, ITreeNode {
- protected InfoComponent infoComponent = new InfoComponent();
+ protected InfoComponentWithCode infoComponent = new InfoComponentWithCode();
private Date initDate;
@@ -1267,9 +1267,9 @@ public abstract class OrderElement extends IntegrationEntity implements
}
@Valid
- public InfoComponent getInfoComponent() {
+ public InfoComponentWithCode getInfoComponent() {
if (infoComponent == null) {
- infoComponent = new InfoComponent();
+ infoComponent = new InfoComponentWithCode();
}
return infoComponent;
}
diff --git a/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml b/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml
index d1ada6218..566468552 100644
--- a/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml
+++ b/libreplan-business/src/main/resources/org/libreplan/business/orders/entities/Orders.hbm.xml
@@ -8,7 +8,7 @@
-
+