Skip to content

Commit

Permalink
Curricula: Multiple Majors
Browse files Browse the repository at this point in the history
- fixed a Hibernate issue when setting up a curriculum with multiple majors (alias used for multiple from-clause elements)
  • Loading branch information
tomas-muller committed Jan 13, 2025
1 parent da39257 commit c0297bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3921,7 +3921,6 @@ private Hashtable<Long, Hashtable<CourseInterface, Map<Long, Double>>> loadClasf

private Hashtable<String, Hashtable<String, Hashtable<Long, Integer>>> loadClasfMajorCourse2ll(org.hibernate.Session hibSession, Curriculum c) {
String select = "f.code, m.code, co.uniqueId, sum(a.weight)";
String from = "CourseOffering co, LastLikeCourseDemand x inner join x.student s inner join s.areaClasfMajors a inner join a.academicClassification f inner join a.major m";
String[] checks = new String[] {
"x.subjectArea.session.uniqueId = :sessionId and a.academicArea.academicAreaAbbreviation = :acadAbbv and co.subjectArea.uniqueId = x.subjectArea.uniqueId and x.coursePermId is not null and co.permId=x.coursePermId",
"x.subjectArea.session.uniqueId = :sessionId and a.academicArea.academicAreaAbbreviation = :acadAbbv and co.subjectArea.uniqueId = x.subjectArea.uniqueId and x.coursePermId is null and co.courseNbr=x.courseNbr",
Expand All @@ -3931,6 +3930,7 @@ private Hashtable<String, Hashtable<String, Hashtable<Long, Integer>>> loadClasf
String group = "f.code, m.code, co.uniqueId";
Hashtable<String, Hashtable<String, Hashtable<Long, Integer>>> clasfMajor2course2ll = new Hashtable<String, Hashtable<String, Hashtable<Long,Integer>>>();
for (String where: checks) {
String from = "CourseOffering co, LastLikeCourseDemand x inner join x.student s inner join s.areaClasfMajors a inner join a.academicClassification f inner join a.major m";
List<Object[]> lines = null;
if (c.getMajors().isEmpty()) {
// students with no major
Expand Down Expand Up @@ -3998,7 +3998,6 @@ private Hashtable<String, Hashtable<String, Hashtable<Long, Integer>>> loadClasf

private Hashtable<String, Hashtable<CourseInterface, HashMap<String, Map<Long, Double>>>> loadClasfCourseMajor2ll(org.hibernate.Session hibSession, String acadAreaAbbv, Collection<PosMajor> majors, boolean multipleMajors) {
String select = "f.code, co.uniqueId, co.subjectArea.subjectAreaAbbreviation || ' ' || co.courseNbr, m.code, s.uniqueId, a.weight";
String from = "CourseOffering co, LastLikeCourseDemand x inner join x.student s inner join s.areaClasfMajors a inner join a.academicClassification f inner join a.major m";
String[] checks = new String[] {
"x.subjectArea.session.uniqueId = :sessionId and a.academicArea.academicAreaAbbreviation = :acadAbbv and co.subjectArea.uniqueId = x.subjectArea.uniqueId and x.coursePermId is not null and co.permId=x.coursePermId",
"x.subjectArea.session.uniqueId = :sessionId and a.academicArea.academicAreaAbbreviation = :acadAbbv and co.subjectArea.uniqueId = x.subjectArea.uniqueId and x.coursePermId is null and co.courseNbr=x.courseNbr",
Expand All @@ -4007,6 +4006,7 @@ private Hashtable<String, Hashtable<CourseInterface, HashMap<String, Map<Long, D
};
Hashtable<String, Hashtable<CourseInterface, HashMap<String, Map<Long, Double>>>> clasf2course2ll = new Hashtable<String, Hashtable<CourseInterface,HashMap<String,Map<Long, Double>>>>();
for (String where: checks) {
String from = "CourseOffering co, LastLikeCourseDemand x inner join x.student s inner join s.areaClasfMajors a inner join a.academicClassification f inner join a.major m";
List<Object[]> lines = new ArrayList<Object[]>();
if (majors.isEmpty()) {
// students with no major
Expand Down
8 changes: 7 additions & 1 deletion WebContent/help/Release-Notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
</line>
</description>
</item>
<item>
<name>Curricula</name>
<description>
<line>Multiple Majors: Fixed a Hibernate issue when setting up a curriculum with multiple majors.</line>
</description>
</item>
</category>
<category>
<title>Instructor Scheduling</title>
Expand All @@ -88,7 +94,7 @@
<line>At Most N Hours A Day: Classes are to be placed in a way that there is no more than given number of hours in any day.</line>
<line>Same Weeks: Given classes must be taught during the same weeks (i.e., must have the same date pattern).</line>
<line>N Hour Workday: Classes are to be placed in a way that there is no more than given number of hours between the start of the first class and the end of the class one on any day.</line>
<line>Mininal Gap Between Classes: Classes need to be placed in a way that there is at least the given number of minutes between any two of them.</line>
<line>Minimal Gap Between Classes: Classes need to be placed in a way that there is at least the given number of minutes between any two of them.</line>
<line>Max Block: Given classes must be taught in a way there is a break between two blocks of classes.</line>
<line>Max Breaks: Limit number of breaks between adjacent classes on a day.</line>
<line>Max Days: Limit number of days of a week.</line>
Expand Down

0 comments on commit c0297bd

Please sign in to comment.