View Javadoc

1   package org.kuali.student.enrollment.class1.hold.dao;
2   
3   import java.util.List;
4   import javax.persistence.Query;
5   import org.kuali.student.enrollment.class1.hold.model.AppliedHoldEntity;
6   import org.kuali.student.r2.common.dao.GenericEntityDao;
7   
8   public class AppliedHoldDao
9           extends GenericEntityDao<AppliedHoldEntity> {
10  
11      public List<String> getIdsByType(String type) {
12          Query query = em.createNamedQuery("AppliedHoldEntity.getIdsByType");
13          query.setParameter("type", type);
14          return query.getResultList();
15      }
16  
17      public List<String> getIdsByIssue(String holdIssueId) {
18          Query query = em.createNamedQuery("AppliedHoldEntity.getIdsByIssue");
19          query.setParameter("holdIssueId", holdIssueId);
20          return query.getResultList();
21      }
22  
23      public List<AppliedHoldEntity> getByPerson(String personId) {
24          Query query = em.createNamedQuery("AppliedHoldEntity.getByPerson");
25          query.setParameter("personId", personId);
26          return query.getResultList();
27      }
28  
29      public List<AppliedHoldEntity> getByPersonAndState(String personId, String stateKey) {
30          Query query = em.createNamedQuery("AppliedHoldEntity.getByPersonAndState");
31          query.setParameter("personId", personId);
32          query.setParameter("stateKey", stateKey);
33          return query.getResultList();
34      }
35      
36      
37      public List<AppliedHoldEntity> getByIssueAndPerson(String holdIssueId, String personId) {
38          Query query = em.createNamedQuery("AppliedHoldEntity.getByIssueAndPerson");
39          query.setParameter("holdIssueId", holdIssueId);
40          query.setParameter("personId", personId);
41          return query.getResultList();
42      } 
43      public List<AppliedHoldEntity> getByIssuePersonAndState(String holdIssueId, String personId, String stateKey) {
44          Query query = em.createNamedQuery("AppliedHoldEntity.getByIssuePersonAndState");
45          query.setParameter("holdIssueId", holdIssueId);
46          query.setParameter("personId", personId);
47          query.setParameter("stateKey", stateKey);
48          return query.getResultList();
49      }
50  }