com.evasion.plugin.travel.dao.BookTravelDAO Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.plugin.travel.dao;
import com.evasion.dao.api.AbstractJPAGenericDAO;
import com.evasion.entity.booktravel.BookTravel;
import java.util.List;
import javax.persistence.Query;
/**
* DAO pour la manipulation des Business Object de type {@link BookTravel}.
*
* @author sebastien
*/
public class BookTravelDAO extends AbstractJPAGenericDAO {
public List findBookTravelByAuthor(String username) {
Query query = getEntityManager().createNamedQuery(BookTravel.QUERY_BOOKTRAVEl_BY_AUTHOR);
query.setParameter(1, username);
return query.getResultList();
}
public List findBookTravelOrderbyDateDepart(int maxResult) {
Query query = getEntityManager().createNamedQuery(BookTravel.QUERY_BOOKTRAVEL_ORDER_BY_DATE_DEPART);
query.setMaxResults(maxResult);
return query.getResultList();
}
}