diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderElementTemplate.java b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderElementTemplate.java
new file mode 100644
index 000000000..d45e5fa2c
--- /dev/null
+++ b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderElementTemplate.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of ###PROJECT_NAME###
+ *
+ * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
+ * Desenvolvemento Tecnolóxico de Galicia
+ *
+ * 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.navalplanner.business.templates.entities;
+
+import org.hibernate.validator.Min;
+import org.hibernate.validator.Valid;
+import org.navalplanner.business.common.BaseEntity;
+import org.navalplanner.business.orders.entities.InfoComponent;
+
+/**
+ * @author Óscar González Fernández
+ *
+ */
+public abstract class OrderElementTemplate extends BaseEntity {
+
+ private InfoComponent infoComponent;
+
+ private Integer startAsDaysFromBeginning;
+
+ private Integer deadlineAsDaysFromBeginning;
+
+ private OrderLineGroupTemplate parent;
+
+ @Valid
+ private InfoComponent getInfoComponent() {
+ if (infoComponent == null) {
+ infoComponent = new InfoComponent();
+ }
+ return infoComponent;
+ }
+
+ @Min(0)
+ public Integer getDeadlineAsDaysFromBeginning() {
+ return deadlineAsDaysFromBeginning;
+ }
+
+ @Min(0)
+ public Integer getStartAsDaysFromBeginning() {
+ return startAsDaysFromBeginning;
+ }
+
+ public String getCode() {
+ return getInfoComponent().getCode();
+ }
+
+ public String getDescription() {
+ return getInfoComponent().getDescription();
+ }
+
+ public String getName() {
+ return getInfoComponent().getName();
+ }
+}
diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineGroupTemplate.java b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineGroupTemplate.java
new file mode 100644
index 000000000..390ccc917
--- /dev/null
+++ b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineGroupTemplate.java
@@ -0,0 +1,33 @@
+/*
+ * This file is part of ###PROJECT_NAME###
+ *
+ * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
+ * Desenvolvemento Tecnolóxico de Galicia
+ *
+ * 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.navalplanner.business.templates.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Óscar González Fernández
+ *
+ */
+public class OrderLineGroupTemplate extends OrderElementTemplate {
+
+ private List children = new ArrayList();
+
+}
diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineTemplate.java b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineTemplate.java
new file mode 100644
index 000000000..09c701dfe
--- /dev/null
+++ b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderLineTemplate.java
@@ -0,0 +1,28 @@
+/*
+ * This file is part of ###PROJECT_NAME###
+ *
+ * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
+ * Desenvolvemento Tecnolóxico de Galicia
+ *
+ * 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.navalplanner.business.templates.entities;
+
+/**
+ * @author Óscar González Fernández
+ *
+ */
+public class OrderLineTemplate extends OrderElementTemplate {
+
+}
diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderTemplate.java b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderTemplate.java
new file mode 100644
index 000000000..715e5b7e1
--- /dev/null
+++ b/navalplanner-business/src/main/java/org/navalplanner/business/templates/entities/OrderTemplate.java
@@ -0,0 +1,34 @@
+/*
+ * This file is part of ###PROJECT_NAME###
+ *
+ * Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
+ * Desenvolvemento Tecnolóxico de Galicia
+ *
+ * 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.navalplanner.business.templates.entities;
+
+import org.hibernate.validator.NotNull;
+import org.navalplanner.business.calendars.entities.BaseCalendar;
+
+/**
+ * @author Óscar González Fernández
+ *
+ */
+public class OrderTemplate extends OrderLineGroupTemplate {
+
+ @NotNull(message = "order calendar not specified")
+ private BaseCalendar calendar;
+
+}
diff --git a/navalplanner-business/src/main/resources/navalplanner-business-spring-config.xml b/navalplanner-business/src/main/resources/navalplanner-business-spring-config.xml
index cfe6f1f10..43b8b27eb 100644
--- a/navalplanner-business/src/main/resources/navalplanner-business-spring-config.xml
+++ b/navalplanner-business/src/main/resources/navalplanner-business-spring-config.xml
@@ -30,6 +30,9 @@
org/navalplanner/business/orders/entities/Orders.hbm.xml
+
+ org/navalplanner/business/templates/entities/Templates.hbm.xml
+
org/navalplanner/business/planner/entities/Tasks.hbm.xml
diff --git a/navalplanner-business/src/main/resources/org/navalplanner/business/templates/entities/Templates.hbm.xml b/navalplanner-business/src/main/resources/org/navalplanner/business/templates/entities/Templates.hbm.xml
new file mode 100644
index 000000000..d35388146
--- /dev/null
+++ b/navalplanner-business/src/main/resources/org/navalplanner/business/templates/entities/Templates.hbm.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ 100
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/navalplanner-business/src/test/resources/navalplanner-business-spring-config-test.xml b/navalplanner-business/src/test/resources/navalplanner-business-spring-config-test.xml
index e2593e4b5..062b2db26 100644
--- a/navalplanner-business/src/test/resources/navalplanner-business-spring-config-test.xml
+++ b/navalplanner-business/src/test/resources/navalplanner-business-spring-config-test.xml
@@ -39,6 +39,9 @@
org/navalplanner/business/orders/entities/Orders.hbm.xml
+
+ org/navalplanner/business/templates/entities/Templates.hbm.xml
+
org/navalplanner/business/planner/entities/Tasks.hbm.xml
diff --git a/navalplanner-webapp/src/test/resources/navalplanner-webapp-spring-config-test.xml b/navalplanner-webapp/src/test/resources/navalplanner-webapp-spring-config-test.xml
index e7cdef582..d3f9c64a1 100644
--- a/navalplanner-webapp/src/test/resources/navalplanner-webapp-spring-config-test.xml
+++ b/navalplanner-webapp/src/test/resources/navalplanner-webapp-spring-config-test.xml
@@ -39,6 +39,9 @@
org/navalplanner/business/orders/entities/Orders.hbm.xml
+
+ org/navalplanner/business/templates/entities/Templates.hbm.xml
+
org/navalplanner/business/planner/entities/Tasks.hbm.xml