ItEr33S14CUCreacionUnidadesPlanificacion: Adding property and mapping for start constraint type

This commit is contained in:
Óscar González Fernández 2009-11-07 17:39:41 +01:00
parent 927c62b54f
commit ec2f71001a
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,29 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package org.navalplanner.business.planner.entities;
/**
* Enum with all possible ways of calculating the start of a task <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
public enum StartConstraintType {
AS_SOON_AS_POSSIBLE, START_NOT_EARLIER_THAN, START_IN_FIXED_DATE;
}

View file

@ -58,6 +58,13 @@ public class Task extends TaskElement {
private Set<ResourceAllocation<?>> resourceAllocations = new HashSet<ResourceAllocation<?>>();
private StartConstraintType startConstraintType = StartConstraintType.AS_SOON_AS_POSSIBLE;
public StartConstraintType getStartConstraintType() {
return startConstraintType != null ? startConstraintType
: StartConstraintType.AS_SOON_AS_POSSIBLE;
}
/**
* Constructor for hibernate. Do not use!
*/

View file

@ -40,6 +40,11 @@
<param name="enumClass">org.navalplanner.business.planner.entities.CalculatedValue</param>
</type>
</property>
<property name="startConstraintType">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">org.navalplanner.business.planner.entities.StartConstraintType</param>
</type>
</property>
<set name="resourceAllocations" cascade="all-delete-orphan">
<key column="TASK" />
<one-to-many class="ResourceAllocation" />