viewAsync = buildAllView(viewIndexed, metadata, couchbaseOperations.getCouchbaseBucket(), couchbaseOperations.getConverter().getTypeKey()); n1qlPrimaryAsync = buildN1qlPrimary(metadata, couchbaseOperations.getCouchbaseBucket()); n1qlSecondaryAsync = buildN1qlSecondary(n1qlSecondaryIndexed, metadata, couchbaseOperations.getCouchbaseBucket(), couchbaseOperations.getConverter().getTypeKey());
viewAsync = buildAllView(viewIndexed, metadata, couchbaseOperations.getCouchbaseBucket(), couchbaseOperations.getConverter().getTypeKey()); n1qlPrimaryAsync = buildN1qlPrimary(metadata, couchbaseOperations.getCouchbaseBucket()); n1qlSecondaryAsync = buildN1qlSecondary(n1qlSecondaryIndexed, metadata, couchbaseOperations.getCouchbaseBucket(), couchbaseOperations.getConverter().getTypeKey());
public StringN1qlBasedQuery(String statement, CouchbaseQueryMethod queryMethod, CouchbaseOperations couchbaseOperations, SpelExpressionParser spelParser, QueryMethodEvaluationContextProvider evaluationContextProvider) { super(queryMethod, couchbaseOperations); this.queryParser = new StringBasedN1qlQueryParser(statement, queryMethod, getCouchbaseOperations().getCouchbaseBucket().name(), getCouchbaseOperations().getConverter(), getTypeField(), getTypeValue()); this.parser = spelParser; this.evaluationContextProvider = evaluationContextProvider; }
public StringN1qlBasedQuery(String statement, CouchbaseQueryMethod queryMethod, CouchbaseOperations couchbaseOperations, SpelExpressionParser spelParser, QueryMethodEvaluationContextProvider evaluationContextProvider) { super(queryMethod, couchbaseOperations); this.queryParser = new StringBasedN1qlQueryParser(statement, queryMethod, getCouchbaseOperations().getCouchbaseBucket().name(), getCouchbaseOperations().getConverter(), getTypeField(), getTypeValue()); this.parser = spelParser; this.evaluationContextProvider = evaluationContextProvider; }
@Override protected Statement getCount(ParameterAccessor accessor, Object[] runtimeParameters) { Expression bucket = i(getCouchbaseOperations().getCouchbaseBucket().name()); WherePath countFrom = select(count("*").as(CountFragment.COUNT_ALIAS)).from(bucket); N1qlCountQueryCreator queryCountCreator = new N1qlCountQueryCreator(partTree, accessor, countFrom, getCouchbaseOperations().getConverter(), getQueryMethod()); Statement statement = queryCountCreator.createQuery(); this.placeHolderValues = queryCountCreator.getPlaceHolderValues(); return statement; }
@Override protected Statement getCount(ParameterAccessor accessor, Object[] runtimeParameters) { Expression bucket = i(getCouchbaseOperations().getCouchbaseBucket().name()); WherePath countFrom = select(count("*").as(CountFragment.COUNT_ALIAS)).from(bucket); N1qlCountQueryCreator queryCountCreator = new N1qlCountQueryCreator(partTree, accessor, countFrom, getCouchbaseOperations().getConverter(), getQueryMethod()); Statement statement = queryCountCreator.createQuery(); this.placeHolderValues = queryCountCreator.getPlaceHolderValues(); return statement; }
Statement countStatement = N1qlUtils.createCountQueryForEntity(getCouchbaseOperations().getCouchbaseBucket().name(), getCouchbaseOperations().getConverter(), getEntityInformation()); SimpleN1qlQuery countQuery = N1qlQuery.simple(countStatement, N1qlParams.build().consistency(consistency)); WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name());
@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()); }
Statement countStatement = N1qlUtils.createCountQueryForEntity(getCouchbaseOperations().getCouchbaseBucket().name(), getCouchbaseOperations().getConverter(), getEntityInformation()); SimpleN1qlQuery countQuery = N1qlQuery.simple(countStatement, N1qlParams.build().consistency(consistency)); WherePath selectFrom = N1qlUtils.createSelectFromForEntity(getCouchbaseOperations().getCouchbaseBucket().name());
@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 protected Statement getStatement(ParameterAccessor accessor, Object[] runtimeParameters, ReturnedType returnedType) { String bucketName = getCouchbaseOperations().getCouchbaseBucket().name(); Expression bucket = N1qlUtils.escapedBucket(bucketName);
@Override protected Statement getStatement(ParameterAccessor accessor, Object[] runtimeParameters, ReturnedType returnedType) { String bucketName = getCouchbaseOperations().getCouchbaseBucket().name(); Expression bucket = N1qlUtils.escapedBucket(bucketName);