All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evasion.plugin.travel.dao.BookTravelDAO Maven / Gradle / Ivy

There is a newer version: 2.0.0.2
Show newest version
/*
 * 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 {

    /**
     * *
     * serialVersionUID.
     */
    private static final long serialVersionUID = 1L;

    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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy