return asPath.where(exp.and(x(CouchbaseConstants.KUNDERA_ENTITY).eq(x("'" + tableName) + "'")));
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(int right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(double right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(float right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(JsonArray right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(String right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(long right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(boolean right) { return and(x(right)); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(JsonObject right) { return and(x(right)); }
@Override protected Expression and(Part part, Expression base, Iterator<Object> iterator) { if (base == null) { return create(part, iterator); } return base.and(create(part, iterator)); }
@Override protected Expression and(Part part, Expression base, Iterator<Object> iterator) { if (base == null) { return create(part, iterator); } return base.and(create(part, iterator)); }
@Override protected Expression and(Part part, Expression base, Iterator<Object> iterator) { if (base == null) { return create(part, iterator); } return base.and(create(part, iterator)); }
@Override protected Expression and(Part part, Expression base, Iterator<Object> iterator) { if (base == null) { return create(part, iterator); } return base.and(create(part, iterator)); }
/** * Produces an {@link Expression} that can serve as a WHERE clause criteria to only select documents in a bucket * that matches a particular Spring Data entity (as given by the {@link EntityMetadata} parameter). * * @param baseWhereCriteria the other criteria of the WHERE clause, or null if none. * @param converter the {@link CouchbaseConverter} giving the attribute storing the type information can be extracted. * @param entityInformation the expected type information. * @return an {@link Expression} to be used as a WHERE clause, that additionally restricts on the given type. */ public static Expression createWhereFilterForEntity(Expression baseWhereCriteria, CouchbaseConverter converter, EntityMetadata<?> entityInformation) { //add part that filters on type key String typeKey = converter.getTypeKey(); String typeValue = entityInformation.getJavaType().getName(); Expression typeSelector = i(typeKey).eq(s(typeValue)); if (baseWhereCriteria == null) { baseWhereCriteria = typeSelector; } else { baseWhereCriteria = x("(" + baseWhereCriteria.toString() + ")").and(typeSelector); } return baseWhereCriteria; }
/** * Produces an {@link Expression} that can serve as a WHERE clause criteria to only select documents in a bucket * that matches a particular Spring Data entity (as given by the {@link EntityMetadata} parameter). * * @param baseWhereCriteria the other criteria of the WHERE clause, or null if none. * @param converter the {@link CouchbaseConverter} giving the attribute storing the type information can be extracted. * @param entityInformation the expected type information. * @return an {@link Expression} to be used as a WHERE clause, that additionally restricts on the given type. */ public static Expression createWhereFilterForEntity(Expression baseWhereCriteria, CouchbaseConverter converter, EntityMetadata<?> entityInformation) { //add part that filters on type key String typeKey = converter.getTypeKey(); String typeValue = entityInformation.getJavaType().getName(); Expression typeSelector = i(typeKey).eq(s(typeValue)); if (baseWhereCriteria == null) { baseWhereCriteria = typeSelector; } else { baseWhereCriteria = x("(" + baseWhereCriteria.toString() + ")").and(typeSelector); } return baseWhereCriteria; }
@Override public Observable<IndexInfo> listN1qlIndexes() { Expression whereClause = x("keyspace_id").eq(s(bucket)) .and(i("using").eq(s("gsi"))); Statement listIndexes = select("idx.*").from(x("system:indexes").as("idx")).where(whereClause) .orderBy(Sort.desc("is_primary"), Sort.asc("name")); final Func1<List<JsonObject>, Observable<AsyncN1qlQueryRow>> errorHandler = errorsToThrowable( "Error while listing indexes: "); return queryExecutor.execute( N1qlQuery.simple(listIndexes, N1qlParams.build().consistency(ScanConsistency.REQUEST_PLUS)), env, env.managementTimeout(), TimeUnit.MILLISECONDS) .flatMap(new Func1<AsyncN1qlQueryResult, Observable<AsyncN1qlQueryRow>>() { @Override public Observable<AsyncN1qlQueryRow> call(final AsyncN1qlQueryResult aqr) { return aqr.finalSuccess() .flatMap(new Func1<Boolean, Observable<AsyncN1qlQueryRow>>() { @Override public Observable<AsyncN1qlQueryRow> call(Boolean success) { if (success) { return aqr.rows(); } else { return aqr.errors().toList().flatMap(errorHandler); } } }); } }).map(ROW_VALUE_TO_INDEXINFO); }
switch (partType) { case BETWEEN: exp = left.between(x(getPlaceHolder(position, ignoreCase)).and(x(getPlaceHolder(position, ignoreCase)))); placeHolderValues.add(getValue(parameterValues)); placeHolderValues.add(getValue(parameterValues));
switch (partType) { case BETWEEN: exp = left.between(x(getPlaceHolder(position, ignoreCase)).and(x(getPlaceHolder(position, ignoreCase)))); placeHolderValues.add(getValue(parameterValues)); placeHolderValues.add(getValue(parameterValues));