File: /var/www/html/unitime/target/classes/Preference.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="Preference" abstract="true">
<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">pref_seq</param>
</generator>
</id>
<many-to-one
name="owner"
class="PreferenceGroup"
column="owner_id"
not-null="true"
insert="true"
lazy="proxy"
update="true"/>
<many-to-one
name="prefLevel"
class="PreferenceLevel"
column="pref_level_id"
not-null="true"
insert="true"
update="true"/>
<property
name="note"
column="note"
type="java.lang.String"
not-null="false"
length="2048"/>
<union-subclass
name="RoomPref"
table="room_pref"
abstract="false">
<many-to-one
name="room"
class="Location"
column="room_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"/>
<property
name="roomIndex"
column="room_idx"
type="java.lang.Integer"
not-null="false"/>
</union-subclass>
<union-subclass
name="RoomFeaturePref"
table="room_feature_pref"
abstract="false">
<many-to-one
name="roomFeature"
class="RoomFeature"
column="room_feature_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"
foreign-key="fk_room_feat_pref_room_feat"/>
<property
name="roomIndex"
column="room_idx"
type="java.lang.Integer"
not-null="false"/>
</union-subclass>
<union-subclass
name="BuildingPref"
table="building_pref"
abstract="false">
<many-to-one
name="building"
class="Building"
column="bldg_id"
not-null="true"
insert="true"
update="true"
foreign-key="fk_bldg_pref_bldg"
lazy="false"
fetch="join"/>
<property
name="distanceFrom"
column="distance_from"
type="java.lang.Integer"
not-null="false"/>
<property
name="roomIndex"
column="room_idx"
type="java.lang.Integer"
not-null="false"/>
</union-subclass>
<union-subclass
name="TimePref"
table="time_pref"
abstract="false">
<property
name="preference"
column="preference"
type="java.lang.String"
not-null="false"
length="2048"
lazy="true"/>
<many-to-one
name="timePattern"
class="TimePattern"
column="time_pattern_id"
not-null="false"
insert="true"
update="true"
foreign-key="fk_time_pref_time_ptrn"
lazy="false"/>
</union-subclass>
<union-subclass
name="DatePatternPref"
table="date_pattern_pref"
abstract="false">
<many-to-one
name="datePattern"
class="DatePattern"
column="date_pattern_id"
not-null="true"
insert="true"
update="true"
foreign-key="fk_date_pref_date_ptrn"
lazy="false"/>
</union-subclass>
<union-subclass
name="DistributionPref"
table="distribution_pref"
abstract="false">
<property
name="grouping"
column="dist_grouping"
type="java.lang.Integer"
length="4"
not-null="false"/>
<many-to-one
name="distributionType"
class="DistributionType"
column="dist_type_id"
not-null="true"
insert="true"
update="true"
foreign-key="fk_dist_pref_dist_type"
lazy="false"
fetch="join"/>
<set
name="distributionObjects"
inverse="true"
lazy="true"
cascade="all-delete-orphan">
<cache include="non-lazy" usage="transactional"/>
<key column="dist_pref_id"/>
<one-to-many class="DistributionObject"/>
</set>
<property
name="uniqueIdRolledForwardFrom"
column="uid_rolled_fwd_from"
type="java.lang.Long"
not-null="false"
length="20"/>
</union-subclass>
<union-subclass
name="RoomGroupPref"
table="room_group_pref"
abstract="false">
<many-to-one
name="roomGroup"
class="RoomGroup"
column="room_group_id"
not-null="true"
insert="true"
update="true"
foreign-key="fk_room_grp_pref_room_grp"
lazy="false"
fetch="join"/>
<property
name="roomIndex"
column="room_idx"
type="java.lang.Integer"
not-null="false"/>
</union-subclass>
<union-subclass
name="ExamPeriodPref"
table="exam_period_pref"
abstract="false">
<many-to-one
name="examPeriod"
class="ExamPeriod"
column="period_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"
foreign-key="fk_exam_period_pref_period"/>
</union-subclass>
<union-subclass
name="InstructorAttributePref"
table="attribute_pref"
abstract="false">
<many-to-one
name="attribute"
class="InstructorAttribute"
column="attribute_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"
foreign-key="fk_attribute_pref_attribute"/>
</union-subclass>
<union-subclass
name="InstructorCoursePref"
table="course_pref"
abstract="false">
<many-to-one
name="course"
class="CourseOffering"
column="course_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"
foreign-key="fk_course_pref_course"/>
</union-subclass>
<union-subclass
name="InstructorPref"
table="instructor_pref"
abstract="false">
<many-to-one
name="instructor"
class="DepartmentalInstructor"
column="instructor_id"
not-null="true"
insert="true"
update="true"
lazy="false"
fetch="join"
foreign-key="fk_instructor_pref_instructor"/>
</union-subclass>
</class>
</hibernate-mapping>