@@ -84,6 +84,8 @@ public List<Appointment> getPendingAppointments(Date forDate) {
8484 */
8585 Session session = sessionFactory .getCurrentSession ();
8686 Criteria criteria = session .createCriteria (Appointment .class );
87+ // Add a check for date_honored being null
88+ criteria .add (Restrictions .isNull ("dateHonored" ));
8789 Date maxDate = new Date (forDate .getTime () + TimeUnit .DAYS .toMillis (1 ));
8890 criteria .add (Restrictions .ge ("startDateTime" , forDate ));
8991 criteria .add (Restrictions .lt ("startDateTime" , maxDate ));
@@ -110,6 +112,8 @@ public List<Appointment> getHonouredAppointments(Date forDate) {
110112 */
111113 Session session = sessionFactory .getCurrentSession ();
112114 Criteria criteria = session .createCriteria (Appointment .class );
115+ // Add a check for date_honored being null
116+ criteria .add (Restrictions .isNull ("dateHonored" ));
113117 Date maxDate = new Date (forDate .getTime () + TimeUnit .DAYS .toMillis (1 ));
114118 criteria .add (Restrictions .ge ("startDateTime" , forDate ));
115119 criteria .add (Restrictions .lt ("startDateTime" , maxDate ));
@@ -136,6 +140,9 @@ public List<Appointment> getCameEarlyAppointments(Date forDate) {
136140 */
137141 Session session = sessionFactory .getCurrentSession ();
138142 Criteria criteria = session .createCriteria (Appointment .class );
143+ // Add a check for date_honored not being null
144+ criteria .add (Restrictions .isNotNull ("dateHonored" ));
145+
139146 Date maxDate = new Date (forDate .getTime () + TimeUnit .DAYS .toMillis (1 ));
140147 criteria .add (Restrictions .ge ("startDateTime" , forDate ));
141148 criteria .add (Restrictions .lt ("startDateTime" , maxDate ));
0 commit comments