@author Tomas Muller, Stephanie Schluttenhofer
| 62 | * @author Tomas Muller, Stephanie Schluttenhofer |
| 63 | */ |
| 64 | @Entity |
| 65 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) |
| 66 | @Table(name = "student") |
| 67 | public class Student extends BaseStudent implements Comparable<Student>, NameInterface, Qualifiable { |
| 68 | private static final long serialVersionUID = 1L; |
| 69 | |
| 70 | /*[CONSTRUCTOR MARKER BEGIN]*/ |
| 71 | public Student () { |
| 72 | super(); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Constructor for primary key |
| 77 | */ |
| 78 | public Student (java.lang.Long uniqueId) { |
| 79 | super(uniqueId); |
| 80 | } |
| 81 | |
| 82 | /*[CONSTRUCTOR MARKER END]*/ |
| 83 | |
| 84 | public static List<Student> findAll(Long sessionId) { |
| 85 | return StudentDAO.getInstance(). |
| 86 | getSession(). |
| 87 | createQuery("select s from Student s where s.session.uniqueId=:sessionId", Student.class). |
| 88 | setParameter("sessionId", sessionId.longValue()). |
| 89 | list(); |
| 90 | } |
| 91 | |
| 92 | public static Student findByExternalId(Long sessionId, String externalId) { |
| 93 | return findByExternalId(StudentDAO.getInstance().getSession(), sessionId, externalId); |
| 94 | } |
| 95 | |
| 96 | public static Student findByExternalId(org.hibernate.Session hibSession, Long sessionId, String externalId) { |
| 97 | return hibSession.createQuery( |
| 98 | "select s from Student s where "+ |
| 99 | "s.session.uniqueId=:sessionId and "+ |
| 100 | "s.externalUniqueId=:externalId", Student.class). |
| 101 | setParameter("sessionId", sessionId.longValue()). |
| 102 | setParameter("externalId", externalId). |
| 103 | setCacheable(true). |
| 104 | uniqueResult(); |
| 105 | } |
| 106 | |
| 107 | public static Student findByExternalIdBringBackEnrollments(org.hibernate.Session hibSession, Long sessionId, String externalId) { |
| 108 | return hibSession. |
| 109 | createQuery("select s from Student s " + |
| 110 | "left join fetch s.courseDemands as cd " + |
| 111 | "left join fetch cd.courseRequests as cr " + |
| 112 | "left join fetch s.classEnrollments as e " + |
| 113 | "left join fetch s.areaClasfMajors " + |
| 114 | "left join fetch s.areaClasfMinors " + |
| 115 | "where "+ |
| 116 | "s.session.uniqueId=:sessionId and "+ |
| 117 | "s.externalUniqueId=:externalId", Student.class). |
| 118 | setParameter("sessionId", sessionId.longValue()). |
| 119 | setParameter("externalId", externalId). |
| 120 | setCacheable(true). |
| 121 | uniqueResult(); |
nothing calls this directly
no outgoing calls
no test coverage detected