use of com.blazebit.persistence.DefaultKeyset in project blaze-persistence by Blazebit.
the class PaginationTest method testExtractIdQueryKeysetPageNonOptimized.
@Test
public void testExtractIdQueryKeysetPageNonOptimized() {
CriteriaBuilder<Tuple> pcb = cbf.create(em, Tuple.class).from(Document.class, "d").select("id").select("contacts[1].name").where("name").eq("doc1").orderByAsc("d.id").setProperty(ConfigurationProperties.OPTIMIZED_KEYSET_PREDICATE_RENDERING, "false");
CriteriaBuilder<Object[]> idQuery = pcb.createPageIdQuery(new DefaultKeysetPage(0, 10, null, new DefaultKeyset(new Serializable[] { 10L })), 10, 10, "d.id");
assertEquals("SELECT d.id FROM Document d WHERE d.name = :param_0 AND (d.id > :_keysetParameter_0) ORDER BY d.id ASC", idQuery.getQueryString());
idQuery.getResultList();
}
Aggregations