Added relationship between Criterion and CostCategories

FEA: ItEr77S17AutomaticBudgeting
This commit is contained in:
Lorenzo Tilve Álvaro 2013-06-06 19:14:33 +02:00
parent 556736af39
commit e5450066de

View file

@ -42,6 +42,7 @@ import org.hibernate.validator.Valid;
import org.joda.time.LocalDate;
import org.libreplan.business.common.IntegrationEntity;
import org.libreplan.business.common.Registry;
import org.libreplan.business.costcategories.entities.CostCategory;
import org.libreplan.business.planner.entities.GenericResourceAllocation;
import org.libreplan.business.requirements.entities.CriterionRequirement;
import org.libreplan.business.resources.daos.ICriterionDAO;
@ -252,6 +253,8 @@ public class Criterion extends IntegrationEntity implements ICriterion,
*/
private Long typeId;
private CostCategory costCategory;
public static Criterion ofType(CriterionType type) {
return create(type);
}
@ -319,6 +322,14 @@ public class Criterion extends IntegrationEntity implements ICriterion,
this.type = type;
}
public CostCategory getCostCategory() {
return costCategory;
}
public void setCostCategory(CostCategory costCategory) {
this.costCategory = costCategory;
}
public String getCompleteName() {
return name + "(" + type.getName() + ")";
}