File: /var/www/html/unitime/target/classes/TimePattern.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!--
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
-->
<hibernate-mapping package="org.unitime.timetable.model">
<class name="TimePattern" table="time_pattern">
<cache include="non-lazy" usage="transactional"/>
<id
name="uniqueId"
column="uniqueid"
type="java.lang.Long">
<generator class="org.unitime.commons.hibernate.id.UniqueIdGenerator">
<param name="sequence">time_pattern_seq</param>
</generator>
</id>
<property
name="name"
column="name"
type="java.lang.String"
length="50"
not-null="false"/>
<many-to-one
name="session"
class="Session"
column="session_id"
not-null="true"
foreign-key="fk_time_pattern_session"/>
<property
name="minPerMtg"
column="mins_pmt"
type="java.lang.Integer"
not-null="false"
length="3"/>
<property
name="slotsPerMtg"
column="slots_pmt"
type="java.lang.Integer"
not-null="false"
length="3"/>
<property
name="nrMeetings"
column="nr_mtgs"
type="java.lang.Integer"
not-null="false"
length="3"/>
<property
name="breakTime"
column="break_time"
type="java.lang.Integer"
not-null="false"
length="3"/>
<property
name="type"
column="type"
type="java.lang.Integer"
not-null="false"
length="2"/>
<property
name="visible"
column="visible"
type="java.lang.Boolean"
not-null="false"/>
<set
name="times"
inverse="false"
cascade="all"
table="time_pattern_time"
lazy="true">
<cache include="non-lazy" usage="transactional"/>
<key column="time_pattern_id" foreign-key="fk_time_pattern_time"/>
<one-to-many class="TimePatternTime"/>
</set>
<set
name="days"
inverse="false"
cascade="all"
table="time_pattern_days"
lazy="true">
<cache include="non-lazy" usage="transactional"/>
<key column="time_pattern_id" foreign-key="fk_time_pattern_days"/>
<one-to-many class="TimePatternDays"/>
</set>
<set
name="departments"
table="time_pattern_dept"
inverse="true">
<cache include="non-lazy" usage="transactional"/>
<key column="pattern_id"/>
<many-to-many
class="Department"
column="dept_id"
foreign-key="fk_time_pattern_dept_dept"/>
</set>
</class>
<class name="TimePatternTime" table="time_pattern_time">
<cache include="non-lazy" usage="transactional"/>
<id
name="uniqueId"
column="uniqueid"
type="java.lang.Long">
<generator class="org.unitime.commons.hibernate.id.UniqueIdGenerator">
<param name="sequence">time_pattern_times_seq</param>
</generator>
</id>
<property
name="startSlot"
column="start_slot"
type="java.lang.Integer"
not-null="false"
length="3"/>
</class>
<class name="TimePatternDays" table="time_pattern_days">
<cache include="non-lazy" usage="transactional"/>
<id
name="uniqueId"
column="uniqueid"
type="java.lang.Long">
<generator class="org.unitime.commons.hibernate.id.UniqueIdGenerator">
<param name="sequence">time_pattern_days_seq</param>
</generator>
</id>
<property
name="dayCode"
column="day_code"
type="java.lang.Integer"
not-null="false"
length="7"/>
</class>
</hibernate-mapping>