File: /var/www/html/unitime/JavaSource/Solution.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="Solution" table="solution">
<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">solution_seq</param>
</generator>
</id>
<property
name="created"
column="created"
type="java.sql.Timestamp"
not-null="true"/>
<property
name="valid"
column="valid"
type="java.lang.Boolean"
not-null="true"/>
<property
name="commited"
column="commited"
type="java.lang.Boolean"
not-null="true"/>
<property
name="commitDate"
column="commit_date"
type="java.sql.Timestamp"
not-null="false"/>
<property
name="note"
column="note"
type="java.lang.String"
not-null="false"
length="1000"/>
<property
name="creator"
column="creator"
type="java.lang.String"
not-null="false"
length="250"/>
<set
name="parameters"
inverse="false"
cascade="all"
table="solver_parameter">
<cache include="non-lazy" usage="transactional"/>
<key column="solution_id" foreign-key="fk_solver_param_solution"/>
<one-to-many class="SolverParameter"/>
</set>
<set
name="solutionInfo"
inverse="true"
cascade="all"
table="solver_info"
lazy="true">
<cache include="non-lazy" usage="transactional"/>
<key column="solution_id"/>
<one-to-many class="SolutionInfo"/>
</set>
<set
name="studentEnrollments"
inverse="true"
cascade="all"
table="student_enrl">
<cache include="non-lazy" usage="transactional"/>
<key column="solution_id"/>
<one-to-many class="StudentEnrollment"/>
</set>
<set
name="assignments"
inverse="true"
cascade="all"
table="assignment">
<cache include="non-lazy" usage="transactional"/>
<key column="solution_id"/>
<one-to-many class="Assignment"/>
</set>
<many-to-one
name="owner"
class="SolverGroup"
column="owner_id"
not-null="true"
lazy="false"
foreign-key="fk_solution_owner"/>
<set
name="jointEnrollments"
inverse="true"
cascade="all"
table="jenrl">
<cache include="non-lazy" usage="transactional"/>
<key column="solution_id"/>
<one-to-many class="JointEnrollment"/>
</set>
<many-to-one
name="globalInfo"
class="org.unitime.timetable.model.SolutionInfo"
not-null="false"
lazy="proxy"
formula=" ( select si.uniqueid from %SCHEMA%.solver_info si, %SCHEMA%.solver_info_def d where si.type=1 and si.solver_info_def_id=d.uniqueid and d.name='GlobalInfo' and si.solution_id=uniqueid ) "/>
<property
name="solverMode"
type="java.lang.String"
lazy="true"
formula="(select p.value from %SCHEMA%.solver_parameter p, %SCHEMA%.solver_parameter_def d where p.solution_id = uniqueid and d.uniqueid = p.solver_param_def_id and d.name='Basic.Mode')"/>
<property
name="solverConfiguration"
type="java.lang.String"
lazy="true"
formula="(select s.description from %SCHEMA%.solver_parameter p, %SCHEMA%.solver_parameter_def d, %SCHEMA%.solver_predef_setting s where p.solution_id = uniqueId and d.uniqueid = p.solver_param_def_id and d.name='General.SettingsId' and concat(s.uniqueid,'') = p.value)"/>
</class>
</hibernate-mapping>