Skip to content

Commit

Permalink
Class Assignment: Bugfix
Browse files Browse the repository at this point in the history
- fixed a Hibernate 6.6 issue when checking Meet Together/Can Share Room distributions
  ExceptionMappingInterceptor> Specified result type [org.unitime.timetable.model.DistributionPref] did not match Query selection type [org.unitime.timetable.model.Preference]
  • Loading branch information
tomas-muller committed Dec 3, 2024
1 parent 615e55b commit c44033d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions JavaSource/org/unitime/timetable/model/Class_.java
Original file line number Diff line number Diff line change
Expand Up @@ -1765,10 +1765,10 @@ public List<DistributionPref> getSharedPreferences(Long classId, Long subpartId,
(types == null || types.length == 0 ? "" : " and o1.distributionPref.distributionType.reference " + (types.length == 1 ? "=" : "in") + " :t"),
DistributionPref.class);
Query<DistributionPref> q2 = Class_DAO.getInstance().getSession().createQuery(
"select p from ClassInstructor c1 inner join c1.instructor.preferences p, ClassInstructor c2 where " +
"c1.classInstructing.uniqueId = :c1 and c2.classInstructing.uniqueId = :c2 and c1.instructor = c2.instructor and type(p) = DistributionPref" +
(preferences == null || preferences.length == 0 ? "" : " and p.prefLevel.prefProlog " + (preferences.length == 1 ? "=" : "in" ) + " :p") +
(types == null || types.length == 0 ? "" : " and p.distributionType.reference " + (types.length == 1 ? "=" : "in") + " :t"),
"select dp from DistributionPref dp, ClassInstructor c1 inner join c1.instructor.preferences p, ClassInstructor c2 where " +
"c1.classInstructing.uniqueId = :c1 and c2.classInstructing.uniqueId = :c2 and c1.instructor = c2.instructor and p = dp" +
(preferences == null || preferences.length == 0 ? "" : " and dp.prefLevel.prefProlog " + (preferences.length == 1 ? "=" : "in" ) + " :p") +
(types == null || types.length == 0 ? "" : " and dp.distributionType.reference " + (types.length == 1 ? "=" : "in") + " :t"),
DistributionPref.class);
q1.setParameter("c1", getUniqueId()).setParameter("s1", getSchedulingSubpart().getUniqueId()).setParameter("c2", classId);
q2.setParameter("c1", getUniqueId()).setParameter("c2", classId);
Expand Down

0 comments on commit c44033d

Please sign in to comment.