ItEr35S08CUAsignacionCalendarioLaboralRecursoItEr25S09: Created Configuration class and set Hibernate mapping.

This commit is contained in:
Manuel Rego Casasnovas 2009-11-17 12:36:14 +01:00 committed by Javier Moran Rua
parent 8ca01326ab
commit 57cd010951
4 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,47 @@
/*
* 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.common.entities;
import org.navalplanner.business.calendars.entities.BaseCalendar;
import org.navalplanner.business.common.BaseEntity;
/**
* Application configuration variables.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*/
public class Configuration extends BaseEntity {
public static Configuration create() {
return create(new Configuration());
}
private BaseCalendar defaultCalendar;
public void setDefaultCalendar(BaseCalendar defaultCalendar) {
this.defaultCalendar = defaultCalendar;
}
public BaseCalendar getDefaultCalendar() {
return defaultCalendar;
}
}

View file

@ -49,6 +49,9 @@
<value>
org/navalplanner/business/requirements/entities/Requirements.hbm.xml
</value>
<value>
org/navalplanner/business/common/entities/Configuration.hbm.xml
</value>
</list>
</property>
</bean>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-access="field"
package="org.navalplanner.business.common.entities">
<!-- Configuration -->
<class name="Configuration">
<id name="id" column="id" type="long" access="property">
<generator class="hilo">
<param name="max_lo">100</param>
</generator>
</id>
<version name="version" access="property" type="long" />
<many-to-one name="defaultCalendar" cascade="none"
column="CONFIGURATION_ID" />
</class>
</hibernate-mapping>

View file

@ -56,6 +56,9 @@
</value>
<value>
org/navalplanner/business/requirements/entities/Requirements.hbm.xml
</value>
<value>
org/navalplanner/business/common/entities/Configuration.hbm.xml
</value>
<value>
TestEntities.hbm.xml