Search in sources :

Example 11 with JPAQueryFactory

use of com.querydsl.jpa.impl.JPAQueryFactory in project jeeshop by remibantos.

the class MailTemplateFinder method findAll.

public List<MailTemplate> findAll(Integer offset, Integer limit, String orderBy, Boolean isDesc) {
    JPAQuery<MailTemplate> query = new JPAQueryFactory(entityManager).selectFrom(mailTemplate);
    if (offset != null)
        query.offset(offset);
    if (limit != null)
        query.limit(limit);
    sortBy(orderBy, isDesc, query);
    return query.fetch();
}
Also used : MailTemplate(org.rembx.jeeshop.user.model.MailTemplate) JPAQueryFactory(com.querydsl.jpa.impl.JPAQueryFactory)

Aggregations

JPAQueryFactory (com.querydsl.jpa.impl.JPAQueryFactory)11 Date (java.util.Date)3 JPAQuery (com.querydsl.jpa.impl.JPAQuery)2 Discount (org.rembx.jeeshop.catalog.model.Discount)2 EntityManager (javax.persistence.EntityManager)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1 Before (org.junit.Before)1 QCatalogItem (org.rembx.jeeshop.catalog.model.QCatalogItem)1 MailTemplate (org.rembx.jeeshop.user.model.MailTemplate)1 User (org.rembx.jeeshop.user.model.User)1