| 1 | |
package org.kuali.student.enrollment.class1.lpr.dao; |
| 2 | |
|
| 3 | |
import static javax.persistence.TemporalType.DATE; |
| 4 | |
|
| 5 | |
import java.util.Date; |
| 6 | |
import java.util.List; |
| 7 | |
|
| 8 | |
import org.kuali.student.enrollment.class1.lpr.model.LprTransactionEntity; |
| 9 | |
import org.kuali.student.enrollment.dao.GenericEntityDao; |
| 10 | |
|
| 11 | 0 | public class LprTransactionDao extends GenericEntityDao<LprTransactionEntity> { |
| 12 | |
|
| 13 | |
public List<LprTransactionEntity> getByDate(Date searchDate) { |
| 14 | 0 | return em.createQuery("from AtpEntity a where :searchDate between a.startDate and a.endDate") |
| 15 | |
.setParameter("searchDate", searchDate, DATE).getResultList(); |
| 16 | |
} |
| 17 | |
|
| 18 | |
public List<LprTransactionEntity> getByDates(Date startDate, Date endDate) { |
| 19 | 0 | return em.createQuery("from AtpEntity a where a.startDate >= :startDate and a.endDate <= :endDate") |
| 20 | |
.setParameter("startDate", startDate, DATE).setParameter("endDate", endDate).getResultList(); |
| 21 | |
} |
| 22 | |
public LprTransactionEntity getByLprTransactionItemId(String lprTransactionItemId) { |
| 23 | 0 | return (LprTransactionEntity) ( em.createQuery("select distinct a from LprTransactionEntity a, IN (a.lprTransactionItems) item where item.id=:lprTransactionItemId") |
| 24 | |
.setParameter("lprTransactionItemId", lprTransactionItemId).getSingleResult()) ; |
| 25 | |
} |
| 26 | |
|
| 27 | |
} |