You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- made a few changes to make UniTime work on PostgreSQL, namely
- booleans cannot be compared with numbers (most of the changes)
- in HQL queries all the boolean comparisons must use boolean constantes
(e.g., instead of CourseOffering.isControl = 1, use CourseOffering.isControl = true)
- in .hbm.xml formulas, use %TRUE% and %FALSE% that can be replaced based on the dialect
- custom XML types do not work
- the remaining two cases replaced by generic types with the XML reading/writing done in the model
- strings cannot be compared with numbers
- when matching on unqiue ids, parameters need to be Longs (there was one case when strings were provided)
- select distinct cannot have order by unless it is ordered by the same expression (one case corrected)
- HibernateUtil extended to allow for PostgreSQL9Dialect
- mostly custom functions for adding dates, binary and, and the day of week
Copy file name to clipboardExpand all lines: JavaSource/PitSchedulingSubpart.hbm.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@
73
73
<property
74
74
name="courseName"
75
75
type="java.lang.String"
76
-
formula="(select concat( concat( sa.subject_area_abbreviation , ' ') , co.course_nbr) from %SCHEMA%.pit_sched_subpart s, %SCHEMA%.pit_instr_offer_config c, %SCHEMA%.pit_instr_offering io, %SCHEMA%.pit_course_offering co, %SCHEMA%.subject_area sa where s.uniqueid=uniqueid and s.pit_config_id=c.uniqueid and c.pit_instr_offr_id=io.uniqueid and co.is_control=1 and co.pit_instr_offr_id=io.uniqueid and co.subject_area_id=sa.uniqueid)"
76
+
formula="(select concat( concat( sa.subject_area_abbreviation , ' ') , co.course_nbr) from %SCHEMA%.pit_sched_subpart s, %SCHEMA%.pit_instr_offer_config c, %SCHEMA%.pit_instr_offering io, %SCHEMA%.pit_course_offering co, %SCHEMA%.subject_area sa where s.uniqueid=uniqueid and s.pit_config_id=c.uniqueid and c.pit_instr_offr_id=io.uniqueid and co.is_control = %TRUE% and co.pit_instr_offr_id=io.uniqueid and co.subject_area_id=sa.uniqueid)"
Copy file name to clipboardExpand all lines: JavaSource/PreferenceGroup.hbm.xml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@
87
87
<property
88
88
name="courseName"
89
89
type="java.lang.String"
90
-
formula="(select concat( concat( sa.subject_area_abbreviation , ' ') , co.course_nbr) from %SCHEMA%.scheduling_subpart s, %SCHEMA%.instr_offering_config c, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co, %SCHEMA%.subject_area sa where s.uniqueid=uniqueid and s.config_id=c.uniqueid and c.instr_offr_id=io.uniqueid and co.is_control=1 and co.instr_offr_id=io.uniqueid and co.subject_area_id=sa.uniqueid)"
90
+
formula="(select concat( concat( sa.subject_area_abbreviation , ' ') , co.course_nbr) from %SCHEMA%.scheduling_subpart s, %SCHEMA%.instr_offering_config c, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co, %SCHEMA%.subject_area sa where s.uniqueid=uniqueid and s.config_id=c.uniqueid and c.instr_offr_id=io.uniqueid and co.is_control = %TRUE% and co.instr_offr_id=io.uniqueid and co.subject_area_id=sa.uniqueid)"
91
91
update="false"
92
92
insert="false"/>
93
93
@@ -102,7 +102,7 @@
102
102
name="controllingCourseOffering"
103
103
class="CourseOffering"
104
104
lazy="proxy"
105
-
formula="(select co.uniqueid from %SCHEMA%.scheduling_subpart s, %SCHEMA%.instr_offering_config c, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co where s.uniqueid=UNIQUEID and s.config_id=c.uniqueid and c.instr_offr_id=io.uniqueid and co.is_control=1 and co.instr_offr_id=io.uniqueid)"
105
+
formula="(select co.uniqueid from %SCHEMA%.scheduling_subpart s, %SCHEMA%.instr_offering_config c, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co where s.uniqueid=UNIQUEID and s.config_id=c.uniqueid and c.instr_offr_id=io.uniqueid and co.is_control = %TRUE% and co.instr_offr_id=io.uniqueid)"
106
106
/>
107
107
-->
108
108
<many-to-one
@@ -227,7 +227,7 @@
227
227
name="controllingDept"
228
228
class="Department"
229
229
lazy="false"
230
-
formula=" ( select sa.department_uniqueid from %SCHEMA%.scheduling_subpart ss, %SCHEMA%.instr_offering_config ioc, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co, %SCHEMA%.subject_area sa where ss.uniqueid = subpart_id and ioc.uniqueid = ss.config_id and io.uniqueid = ioc.instr_offr_id and co.instr_offr_id = io.uniqueid and co.is_control = 1 and sa.uniqueid = co.subject_area_id ) "/>
230
+
formula=" ( select sa.department_uniqueid from %SCHEMA%.scheduling_subpart ss, %SCHEMA%.instr_offering_config ioc, %SCHEMA%.instructional_offering io, %SCHEMA%.course_offering co, %SCHEMA%.subject_area sa where ss.uniqueid = subpart_id and ioc.uniqueid = ss.config_id and io.uniqueid = ioc.instr_offr_id and co.instr_offr_id = io.uniqueid and co.is_control = %TRUE% and sa.uniqueid = co.subject_area_id ) "/>
231
231
232
232
<many-to-one
233
233
name="managingDept"
@@ -356,7 +356,7 @@
356
356
class="org.unitime.timetable.model.Assignment"
357
357
not-null="false"
358
358
lazy="proxy"
359
-
formula=" ( select a.uniqueid from %SCHEMA%.assignment a, %SCHEMA%.solution s, %SCHEMA%.department d, %SCHEMA%.solver_group g where a.class_id=uniqueid and a.solution_id=s.uniqueid and s.commited=1 and d.uniqueid=managing_dept and s.owner_id=g.uniqueid and d.solver_group_id=g.uniqueid ) "/>
359
+
formula=" ( select a.uniqueid from %SCHEMA%.assignment a, %SCHEMA%.solution s, %SCHEMA%.department d, %SCHEMA%.solver_group g where a.class_id=uniqueid and a.solution_id=s.uniqueid and s.commited = %TRUE% and d.uniqueid=managing_dept and s.owner_id=g.uniqueid and d.solver_group_id=g.uniqueid ) "/>
0 commit comments