}
@SuppressWarnings("unchecked")
@Override
public Page<T> query(Execute query, Execute countQuery, Map<String, Object> params, Pageable page) {
final Execute limitedQuery = ((Skip)query).skip(page.getOffset()).limit(page.getPageSize());
CypherQueryEngine engine = template.queryEngineFor();
Page result = engine.query(limitedQuery.toString(), params).to(clazz).as(Page.class);
if (countQuery == null) {
return result;
}
Long count = engine.query(countQuery.toString(), params).to(Long.class).singleOrNull();
if (count==null) return result;