ItEr34S15CUAdministracionCategoriaCoste: Skeleton for entities CostCategory, HourCost and TypeOfWorkHours

Created the entities: CostCategory, HourCost and TypeOfWorkHours.
They have simple attributes and get/set methods for them.
This commit is contained in:
Jacobo Aragunde Pérez 2009-12-02 20:58:14 +01:00 committed by Javier Moran Rua
parent 8aef6af117
commit cc9ae3fef7
3 changed files with 221 additions and 0 deletions

View file

@ -0,0 +1,54 @@
/*
* 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.costcategories.entities;
import org.hibernate.validator.NotEmpty;
import org.navalplanner.business.common.BaseEntity;
/**
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
*/
public class CostCategory extends BaseEntity {
@NotEmpty
private String name;
// Default constructor, needed by Hibernate
protected CostCategory() {
}
public static CostCategory create(String name) {
return (CostCategory) create(new CostCategory(name));
}
protected CostCategory(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View file

@ -0,0 +1,79 @@
/*
* 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.costcategories.entities;
import java.math.BigDecimal;
import java.util.Date;
import org.hibernate.validator.NotEmpty;
import org.navalplanner.business.common.BaseEntity;
/**
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
*/
public class HourCost extends BaseEntity {
@NotEmpty
private BigDecimal priceCost;
@NotEmpty
private Date initDate;
private Date endDate;
// Default constructor, needed by Hibernate
protected HourCost() {
}
public static HourCost create(BigDecimal priceCost, Date initDate) {
return (HourCost) create(new HourCost(priceCost, initDate));
}
protected HourCost(BigDecimal priceCost, Date initDate) {
this.priceCost = priceCost;
this.initDate = initDate;
}
public BigDecimal getPriceCost() {
return priceCost;
}
public void setPriceCost(BigDecimal priceCost) {
this.priceCost = priceCost;
}
public Date getInitDate() {
return initDate;
}
public void setInitDate(Date initDate) {
this.initDate = initDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
}

View file

@ -0,0 +1,88 @@
/*
* 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.costcategories.entities;
import java.math.BigDecimal;
import org.hibernate.validator.NotEmpty;
import org.navalplanner.business.common.BaseEntity;
/**
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
*/
public class TypeOfWorkHours extends BaseEntity {
@NotEmpty
private String code;
@NotEmpty
private String name;
private BigDecimal defaultPrice;
boolean enabled = true;
// Default constructor, needed by Hibernate
protected TypeOfWorkHours() {
}
public static TypeOfWorkHours create(String code, String name) {
return (TypeOfWorkHours) create(new TypeOfWorkHours(code, name));
}
protected TypeOfWorkHours(String code, String name) {
this.code = code;
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public BigDecimal getDefaultPrice() {
return defaultPrice;
}
public void setDefaultPrice(BigDecimal price) {
this.defaultPrice = price;
}
public boolean getEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}