Search in sources :

Example 1 with CourseStudentVariableDAO

use of fi.otavanopisto.pyramus.dao.courses.CourseStudentVariableDAO in project pyramus by otavanopisto.

the class CoursesService method getCourseStudentVariable.

public String getCourseStudentVariable(@WebParam(name = "courseStudentId") Long courseStudentId, @WebParam(name = "key") String key) {
    CourseStudentDAO courseStudentDAO = DAOFactory.getInstance().getCourseStudentDAO();
    CourseStudentVariableDAO courseStudentVariableDAO = DAOFactory.getInstance().getCourseStudentVariableDAO();
    CourseStudent courseStudent = courseStudentDAO.findById(courseStudentId);
    return courseStudentVariableDAO.findByCourseStudentAndKey(courseStudent, key);
}
Also used : CourseStudentVariableDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentVariableDAO) CourseStudentDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentDAO) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent)

Example 2 with CourseStudentVariableDAO

use of fi.otavanopisto.pyramus.dao.courses.CourseStudentVariableDAO in project pyramus by otavanopisto.

the class CoursesService method setCourseStudentVariable.

public void setCourseStudentVariable(@WebParam(name = "courseStudentId") Long courseStudentId, @WebParam(name = "key") String key, @WebParam(name = "value") String value) {
    CourseStudentDAO courseStudentDAO = DAOFactory.getInstance().getCourseStudentDAO();
    CourseStudentVariableDAO courseStudentVariableDAO = DAOFactory.getInstance().getCourseStudentVariableDAO();
    CourseStudent courseStudent = courseStudentDAO.findById(courseStudentId);
    courseStudentVariableDAO.setCourseStudentVariable(courseStudent, key, value);
}
Also used : CourseStudentVariableDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentVariableDAO) CourseStudentDAO(fi.otavanopisto.pyramus.dao.courses.CourseStudentDAO) CourseStudent(fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent)

Aggregations

CourseStudentDAO (fi.otavanopisto.pyramus.dao.courses.CourseStudentDAO)2 CourseStudentVariableDAO (fi.otavanopisto.pyramus.dao.courses.CourseStudentVariableDAO)2 CourseStudent (fi.otavanopisto.pyramus.domainmodel.courses.CourseStudent)2