@Override protected LimitPath complete(Expression criteria, Sort sort) { Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(criteria, this.converter, this.queryMethod.getEntityInformation()); OrderByPath selectFromWhere = selectFrom.where(whereCriteria); //sort of the Pageable takes precedence over the sort in the query name if ((queryMethod.isPageQuery() || queryMethod.isSliceQuery()) && accessor.getPageable().isPaged()) { Pageable pageable = accessor.getPageable(); sort = pageable.getSort(); } if (sort.isSorted()) { com.couchbase.client.java.query.dsl.Sort[] cbSorts = N1qlUtils.createSort(sort, converter); return selectFromWhere.orderBy(cbSorts); } return selectFromWhere; }
@Override protected LimitPath complete(Expression criteria, Sort sort) { Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(criteria, this.converter, this.queryMethod.getEntityInformation()); OrderByPath selectFromWhere = selectFrom.where(whereCriteria); //sort of the Pageable takes precedence over the sort in the query name if ((queryMethod.isPageQuery() || queryMethod.isSliceQuery()) && accessor.getPageable().isPaged()) { Pageable pageable = accessor.getPageable(); sort = pageable.getSort(); } if (sort.isSorted()) { com.couchbase.client.java.query.dsl.Sort[] cbSorts = N1qlUtils.createSort(sort, converter); return selectFromWhere.orderBy(cbSorts); } return selectFromWhere; }
@Override public Iterable<T> findAll(Sort sort) { Assert.notNull(sort, "Sort must not be null!"); //prepare elements of the query WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name()); Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(null, getCouchbaseOperations().getConverter(), getEntityInformation()); //apply the sort com.couchbase.client.java.query.dsl.Sort[] orderings = N1qlUtils.createSort(sort, getCouchbaseOperations().getConverter()); Statement st = selectFrom.where(whereCriteria).orderBy(orderings); //fire the query ScanConsistency consistency = getCouchbaseOperations().getDefaultConsistency().n1qlConsistency(); N1qlQuery query = N1qlQuery.simple(st, N1qlParams.build().consistency(consistency)); return getCouchbaseOperations().findByN1QL(query, getEntityInformation().getJavaType()); }
@Override public Iterable<T> findAll(Sort sort) { Assert.notNull(sort, "Sort must not be null!"); //prepare elements of the query WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name()); Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(null, getCouchbaseOperations().getConverter(), getEntityInformation()); //apply the sort com.couchbase.client.java.query.dsl.Sort[] orderings = N1qlUtils.createSort(sort, getCouchbaseOperations().getConverter()); Statement st = selectFrom.where(whereCriteria).orderBy(orderings); //fire the query ScanConsistency consistency = getCouchbaseOperations().getDefaultConsistency().n1qlConsistency(); N1qlQuery query = N1qlQuery.simple(st, N1qlParams.build().consistency(consistency)); return getCouchbaseOperations().findByN1QL(query, getEntityInformation().getJavaType()); }
@SuppressWarnings("unchecked") @Override public Flux<T> findAll(Sort sort) { Assert.notNull(sort); //prepare elements of the query WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name()); Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(null, getCouchbaseOperations().getConverter(), getEntityInformation()); //apply the sort com.couchbase.client.java.query.dsl.Sort[] orderings = N1qlUtils.createSort(sort, getCouchbaseOperations().getConverter()); Statement st = selectFrom.where(whereCriteria).orderBy(orderings); //fire the query ScanConsistency consistency = getCouchbaseOperations().getDefaultConsistency().n1qlConsistency(); N1qlQuery query = N1qlQuery.simple(st, N1qlParams.build().consistency(consistency)); return mapFlux(getCouchbaseOperations().findByN1QL(query, getEntityInformation().getJavaType())); }
@SuppressWarnings("unchecked") @Override public Flux<T> findAll(Sort sort) { Assert.notNull(sort); //prepare elements of the query WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name()); Expression whereCriteria = N1qlUtils.createWhereFilterForEntity(null, getCouchbaseOperations().getConverter(), getEntityInformation()); //apply the sort com.couchbase.client.java.query.dsl.Sort[] orderings = N1qlUtils.createSort(sort, getCouchbaseOperations().getConverter()); Statement st = selectFrom.where(whereCriteria).orderBy(orderings); //fire the query ScanConsistency consistency = getCouchbaseOperations().getDefaultConsistency().n1qlConsistency(); N1qlQuery query = N1qlQuery.simple(st, N1qlParams.build().consistency(consistency)); return mapFlux(getCouchbaseOperations().findByN1QL(query, getEntityInformation().getJavaType())); }
GroupByPath groupBy = selectFrom.where(whereCriteria);
GroupByPath groupBy = selectFrom.where(whereCriteria);