| 1 | |
package org.kuali.student.enrollment.class1.lpr.dao; |
| 2 | |
|
| 3 | |
|
| 4 | |
import java.util.List; |
| 5 | |
|
| 6 | |
import org.kuali.student.enrollment.class1.lpr.model.LuiPersonRelationEntity; |
| 7 | |
import org.kuali.student.enrollment.dao.GenericEntityDao; |
| 8 | |
|
| 9 | |
|
| 10 | 0 | public class LprDao extends GenericEntityDao<LuiPersonRelationEntity> { |
| 11 | |
|
| 12 | |
@SuppressWarnings({"unchecked"}) |
| 13 | |
public List<LuiPersonRelationEntity> getByLuiId(String luiId) { |
| 14 | 0 | return em.createQuery("from LuiPersonRelationEntity lpr where lpr.luiId=:luiId").setParameter("luiId", luiId).getResultList(); |
| 15 | |
} |
| 16 | |
|
| 17 | |
public List<String> getLprIdsByLuiAndPerson(String personId, String luiId) { |
| 18 | 0 | return em.createQuery("select lpr.id from LuiPersonRelationEntity lpr where lpr.personId=:personId and lpr.luiId=:luiId").setParameter("personId", personId).setParameter("luiId", luiId).getResultList(); |
| 19 | |
} |
| 20 | |
|
| 21 | |
public List<LuiPersonRelationEntity> getLprsByPersonAndType(String personId,String typeKey){ |
| 22 | 0 | return em.createQuery("from LuiPersonRelationEntity lpr where lpr.personId=:personId and lpr.personRelationTypeId=:typeKey").setParameter("personId", personId).setParameter("typeKey", typeKey).getResultList(); |
| 23 | |
} |
| 24 | |
|
| 25 | |
|
| 26 | |
public List<LuiPersonRelationEntity> getLprsByPerson(String personId){ |
| 27 | 0 | return em.createQuery("from LuiPersonRelationEntity lpr where lpr.personId=:personId").setParameter("personId", personId).getResultList(); |
| 28 | |
} |
| 29 | |
|
| 30 | |
@SuppressWarnings("unchecked") |
| 31 | |
public List<String> getPersonIdsByLui(String luiId, String typeKey, String stateKey){ |
| 32 | 0 | return em.createQuery("select lpr.personId from LuiPersonRelationEntity lpr where lpr.luiId=:luiId and lpr.personRelationTypeId=:typeKey and lpr.personRelationStateId=:stateKey") |
| 33 | |
.setParameter("luiId", luiId) |
| 34 | |
.setParameter("typeKey", typeKey) |
| 35 | |
.setParameter("stateKey", stateKey) |
| 36 | |
.getResultList(); |
| 37 | |
} |
| 38 | |
|
| 39 | |
public List<LuiPersonRelationEntity> getLprByLuiAndPerson(String personId, String luiId) { |
| 40 | 0 | return em.createQuery("from LuiPersonRelationEntity lpr where lpr.personId=:personId and lpr.luiId=:luiId") |
| 41 | |
.setParameter("personId", personId) |
| 42 | |
.setParameter("luiId", luiId) |
| 43 | |
.getResultList(); |
| 44 | |
} |
| 45 | |
|
| 46 | |
public List<LuiPersonRelationEntity> getLprsByLuiPersonAndState(String personId, String luiId, String stateKey) { |
| 47 | 0 | return em.createQuery("from LuiPersonRelationEntity lpr where lpr.personId=:personId and lpr.luiId=:luiId and lpr.personRelationStateId=:stateKey") |
| 48 | |
.setParameter("personId", personId) |
| 49 | |
.setParameter("luiId", luiId) |
| 50 | |
.setParameter("stateKey", stateKey) |
| 51 | |
.getResultList(); |
| 52 | |
} |
| 53 | |
} |