use of com.querydsl.core.QueryModifiers in project querydsl by querydsl.
the class LuceneQueryTest method list_sorted_ascending_by_year_restrict_limit_2_offset_1.
@Test
public void list_sorted_ascending_by_year_restrict_limit_2_offset_1() {
query.where(year.between(1800, 2000));
query.restrict(new QueryModifiers(2L, 1L));
query.orderBy(year.asc());
final List<Document> documents = query.fetch();
assertFalse(documents.isEmpty());
assertEquals(2, documents.size());
assertEquals("1954", documents.get(0).get("year"));
assertEquals("1990", documents.get(1).get("year"));
}
use of com.querydsl.core.QueryModifiers in project querydsl by querydsl.
the class LuceneQueryTest method list_sorted_ascending_by_year_restrict_limit_2_offset_1.
@Test
public void list_sorted_ascending_by_year_restrict_limit_2_offset_1() {
query.where(year.between(1800, 2000));
query.restrict(new QueryModifiers(2L, 1L));
query.orderBy(year.asc());
final List<Document> documents = query.fetch();
assertFalse(documents.isEmpty());
assertEquals(2, documents.size());
assertEquals("1954", documents.get(0).get("year"));
assertEquals("1990", documents.get(1).get("year"));
}
Aggregations