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

com.evasion.plugin.travel.dao.RoadMapDAO 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.RoadMap;
import java.util.List;
import javax.persistence.Query;

/**
 * DAO pour la manipulation des Business Object de type {@link RoadMap}.
 * @author sebastien
 */
public class RoadMapDAO extends AbstractJPAGenericDAO {

    public List selectRoadMapByDescendingExecutionDate(
            final Long idBookTravel, final int maxResult) {
        Query query = getEntityManager().createQuery("select r " +
                "from RoadMap r " +
                "where r.bookTravel.id=:id " +
                "order by r.executionDateInternal desc");
        query.setParameter("id", idBookTravel);
        if (maxResult>0) {
            query.setMaxResults(maxResult);
        }
        return query.getResultList();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy