| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.r2.core.class1.organization.dao; |
| 17 | |
|
| 18 | |
import java.util.List; |
| 19 | |
|
| 20 | |
import org.kuali.student.core.organization.entity.OrgPersonRelation; |
| 21 | |
import org.kuali.student.enrollment.dao.GenericEntityDao; |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | 0 | public class OrgPersonRelationDao extends GenericEntityDao<OrgPersonRelation> { |
| 29 | |
|
| 30 | |
@SuppressWarnings("unchecked") |
| 31 | |
public List<OrgPersonRelation> getOrgPersonRelationsByTypeAndOrg(String orgPersonRelationTypeKey, String orgId) { |
| 32 | 0 | return em.createQuery("from OrgPersonRelation r where r.orgPersonRelationType.id = :orgPersonRelationTypeKey and" + |
| 33 | |
" r.org.id = :orgId") |
| 34 | |
.setParameter("orgPersonRelationTypeKey", orgPersonRelationTypeKey).setParameter("orgId", orgId).getResultList(); |
| 35 | |
} |
| 36 | |
|
| 37 | |
@SuppressWarnings("unchecked") |
| 38 | |
public List<OrgPersonRelation> getOrgPersonRelationsByPerson(String personId) { |
| 39 | 0 | return em.createQuery("from OrgPersonRelation r where r.personId = :personId") |
| 40 | |
.setParameter("personId", personId).getResultList(); |
| 41 | |
} |
| 42 | |
|
| 43 | |
@SuppressWarnings("unchecked") |
| 44 | |
public List<OrgPersonRelation> getOrgPersonRelationsByTypeAndPerson(String orgPersonRelationTypeKey, String personId) { |
| 45 | 0 | return em.createQuery("from OrgPersonRelation r where r.orgPersonRelationType.id = :orgPersonRelationTypeKey and" + |
| 46 | |
" r.personId = :personId") |
| 47 | |
.setParameter("orgPersonRelationTypeKey", orgPersonRelationTypeKey).setParameter("personId", personId).getResultList(); |
| 48 | |
} |
| 49 | |
|
| 50 | |
@SuppressWarnings("unchecked") |
| 51 | |
public List<OrgPersonRelation> getOrgPersonRelationsByOrgAndPerson(String orgId, String personId) { |
| 52 | 0 | return em.createQuery("from OrgPersonRelation r where r.org.id = :orgId and r.personId = :personId") |
| 53 | |
.setParameter("orgId", orgId).setParameter("personId", personId).getResultList(); |
| 54 | |
} |
| 55 | |
|
| 56 | |
@SuppressWarnings("unchecked") |
| 57 | |
public List<OrgPersonRelation> getOrgPersonRelationsByTypeAndOrgAndPerson(String orgPersonRelationTypeKey, String orgId, String personId) { |
| 58 | 0 | return em.createQuery("from OrgPersonRelation r where r.orgPersonRelationType.id = :orgPersonRelationTypeKey and" + |
| 59 | |
" r.org.id = :orgId and r.personId = :personId") |
| 60 | |
.setParameter("orgPersonRelationTypeKey", orgPersonRelationTypeKey).setParameter("orgId", orgId) |
| 61 | |
.setParameter("personId", personId).getResultList(); |
| 62 | |
} |
| 63 | |
|
| 64 | |
|
| 65 | |
} |