Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILessonDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILessonDAO.java,v diff -u -r1.17 -r1.18 --- lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILessonDAO.java 18 Jun 2006 13:07:19 -0000 1.17 +++ lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILessonDAO.java 17 Sep 2006 03:40:57 -0000 1.18 @@ -91,14 +91,6 @@ public List getLessonsCreatedByUser(Integer userID); /** - * Gets all lessons for which this user is in the staff group. Does not return - * disabled lessons or preview lessons. This is the list of lessons that a user may monitor/moderate/manage. - * @param user a User that identifies the teacher/staff member. - * @return a List with all appropriate lessons in it. - */ - public List getLessonsForMonitoring(final int userID); - - /** * Gets all lessons in the given organisation, for which this user is in the staff group. Does not return * disabled lessons or preview lessons. This is the list of lessons that a user may monitor/moderate/manage. * @param user a User that identifies the teacher/staff member. Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LessonDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LessonDAO.java,v diff -u -r1.23 -r1.24 --- lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LessonDAO.java 18 Jun 2006 13:07:19 -0000 1.23 +++ lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LessonDAO.java 17 Sep 2006 03:40:57 -0000 1.24 @@ -170,6 +170,7 @@ /** * @see org.lamsfoundation.lams.lesson.dao.ILessonDAO#getActiveLearnerByLesson(long) + * Note: Hibernate 3.1 query.uniqueResult() returns Integer, Hibernate 3.2 query.uniqueResult() returns Long */ public Integer getCountActiveLearnerByLesson(final long lessonId) { @@ -179,11 +180,12 @@ throws HibernateException { Query query = session.createQuery(COUNT_ACTIVE_LEARNERS); query.setLong("lessonId", lessonId); - return query.uniqueResult(); + Object value = query.uniqueResult(); + return new Integer (((Number)value).intValue()); } }); } -/** +/**f * Saves or Updates a Lesson. * @param lesson */ @@ -225,31 +227,6 @@ } /** - * Gets all lessons for which this user is in the staff group. Does not return - * disabled lessons or preview lessons. This is the list of lessons that a user may monitor/moderate/manage. - * TODO remove once the dummy interface is removed - it is replaced by getLessonsForMonitoring(userId, organisationId) - * TODO remove the matching query in the Hibernate file. - * @param user a User that identifies the teacher/staff member. - * @return a List with all appropriate lessons in it. - */ - public List getLessonsForMonitoring(final int userID) - { - List lessons = null; - - HibernateTemplate hibernateTemplate = new HibernateTemplate(this.getSessionFactory()); - lessons = (List)hibernateTemplate.execute( - new HibernateCallback() { - public Object doInHibernate(Session session) throws HibernateException { - Query query = session.getNamedQuery("lessonsForMonitoringByUser"); - query.setInteger("userId", userID); - List result = query.list(); - return result; - } - } - ); - return lessons; - } - /** * Gets all lessons in the given organisation, for which this user is in the staff group. Does not return * disabled lessons or preview lessons. This is the list of lessons that a user may monitor/moderate/manage. * @param user a User that identifies the teacher/staff member.