return null; final AqlQueryOptions options = new AqlQueryOptions(); final int batchSize = queryOptions.batchSize(); if (batchSize != -1) { options.batchSize(batchSize); options.maxPlans(maxPlans); options.ttl(ttl); options.cache(queryOptions.cache()); options.count(queryOptions.count()); options.fullCount(queryOptions.fullCount()); options.profile(queryOptions.profile()); options.rules(Arrays.asList(queryOptions.rules())); final boolean stream = queryOptions.stream(); if (stream) { options.stream(stream); options.memoryLimit(memoryLimit); options.allowDirtyRead(allowDirtyRead);
public static AqlQueryExplainOptions build( final AqlQueryExplainOptions options, final String query, final Map<String, Object> bindVars) { return options.query(query).bindVars(bindVars); }
protected Request queryCloseRequest(final String id, final AqlQueryOptions options) { final Request request = request(name, RequestType.DELETE, PATH_API_CURSOR, id); final AqlQueryOptions opt = options != null ? options : new AqlQueryOptions(); if (opt.getAllowDirtyRead() == Boolean.TRUE) { RequestUtils.allowDirtyRead(request); } return request; }
final Integer batchSize = newDynamic.getBatchSize(); if (batchSize != null) { oldStatic.batchSize(batchSize); final Integer maxPlans = newDynamic.getMaxPlans(); if (maxPlans != null) { oldStatic.maxPlans(maxPlans); final Integer ttl = newDynamic.getTtl(); if (ttl != null) { oldStatic.ttl(ttl); final Boolean cache = newDynamic.getCache(); if (cache != null) { oldStatic.cache(cache); final Boolean count = newDynamic.getCount(); if (count != null) { oldStatic.count(count); final Boolean fullCount = newDynamic.getFullCount(); if (fullCount != null) { oldStatic.fullCount(fullCount); final Boolean profile = newDynamic.getProfile(); if (profile != null) { oldStatic.profile(profile); final Collection<String> rules = newDynamic.getRules();
private <S extends T> ArangoCursor<T> findAllInternal( final Pageable pageable, @Nullable final Example<S> example, final Map<String, Object> bindVars) { final String query = String.format("FOR e IN %s %s %s RETURN e", getCollectionName(), buildFilterClause(example, bindVars), buildPageableClause(pageable, "e")); return arangoOperations.query(query, bindVars, pageable != null && pageable.isPaged() ? new AqlQueryOptions().fullCount(true) : null, domainClass); }
private ArangoCursor<?> _resolve(final String id, final Class<?> type, final boolean limit) { final String query = String.format("FOR e IN @@edge FILTER e._from == @id %s RETURN e", limit ? "LIMIT 1" : ""); return template.query(query, new MapBuilder().put("@edge", type).put("id", id).get(), new AqlQueryOptions(), type); }
final Integer batchSize = newDynamic.getBatchSize(); if (batchSize != null) { oldStatic.batchSize(batchSize); final Integer maxPlans = newDynamic.getMaxPlans(); if (maxPlans != null) { oldStatic.maxPlans(maxPlans); final Integer ttl = newDynamic.getTtl(); if (ttl != null) { oldStatic.ttl(ttl); final Boolean cache = newDynamic.getCache(); if (cache != null) { oldStatic.cache(cache); final Boolean count = newDynamic.getCount(); if (count != null) { oldStatic.count(count); final Boolean fullCount = newDynamic.getFullCount(); if (fullCount != null) { oldStatic.fullCount(fullCount); final Boolean profile = newDynamic.getProfile(); if (profile != null) { oldStatic.profile(profile); final Collection<String> rules = newDynamic.getRules();
private <S extends T> ArangoCursor<T> findAllInternal( final Pageable pageable, @Nullable final Example<S> example, final Map<String, Object> bindVars) { final String query = String.format("FOR e IN %s %s %s RETURN e", getCollectionName(), buildFilterClause(example, bindVars), buildPageableClause(pageable, "e")); return arangoOperations.query(query, bindVars, pageable != null && pageable.isPaged() ? new AqlQueryOptions().fullCount(true) : null, domainClass); }
private ArangoCursor<?> _resolve(final String id, final Class<?> type, final boolean limit) { final String query = String.format("FOR e IN @@edge FILTER e._to == @id RETURN e", limit ? "LIMIT 1" : ""); return template.query(query, new MapBuilder().put("@edge", type).put("id", id).get(), new AqlQueryOptions(), type); }
return null; final AqlQueryOptions options = new AqlQueryOptions(); final int batchSize = queryOptions.batchSize(); if (batchSize != -1) { options.batchSize(batchSize); options.maxPlans(maxPlans); options.ttl(ttl); options.cache(queryOptions.cache()); options.count(queryOptions.count()); options.fullCount(queryOptions.fullCount()); options.profile(queryOptions.profile()); options.rules(Arrays.asList(queryOptions.rules())); final boolean stream = queryOptions.stream(); if (stream) { options.stream(stream); options.memoryLimit(memoryLimit); options.allowDirtyRead(allowDirtyRead);
@Override public Object execute(final Object[] parameters) { final ArangoParameterAccessor accessor = new ArangoParametersParameterAccessor(method, parameters); final Map<String, Object> bindVars = new HashMap<>(); AqlQueryOptions options = mergeQueryOptions(method.getAnnotatedQueryOptions(), accessor.getQueryOptions()); if (options == null) { options = new AqlQueryOptions(); } if (method.isPageQuery()) { options.fullCount(true); } final String query = createQuery(accessor, bindVars, options); final ResultProcessor processor = method.getResultProcessor().withDynamicProjection(accessor); final Class<?> typeToRead = getTypeToRead(processor); final ArangoCursor<?> result = operations.query(query, bindVars, options, typeToRead); logWarningsIfNecessary(result); return processor.processResult(convertResult(result, accessor)); }
protected Request queryNextRequest(final String id, final AqlQueryOptions options) { final Request request = request(name, RequestType.PUT, PATH_API_CURSOR, id); final AqlQueryOptions opt = options != null ? options : new AqlQueryOptions(); if (opt.getAllowDirtyRead() == Boolean.TRUE) { RequestUtils.allowDirtyRead(request); } return request; }
private ArangoCursor<?> _resolve(final String id, final Class<?> type, final boolean limit) { final String query = String.format("FOR e IN @@edge FILTER e._from == @id %s RETURN e", limit ? "LIMIT 1" : ""); return template.query(query, new MapBuilder().put("@edge", type).put("id", id).get(), new AqlQueryOptions(), type); }
@Override public Object execute(final Object[] parameters) { final ArangoParameterAccessor accessor = new ArangoParametersParameterAccessor(method, parameters); final Map<String, Object> bindVars = new HashMap<>(); AqlQueryOptions options = mergeQueryOptions(method.getAnnotatedQueryOptions(), accessor.getQueryOptions()); if (options == null) { options = new AqlQueryOptions(); } if (method.isPageQuery()) { options.fullCount(true); } final String query = createQuery(accessor, bindVars, options); final ResultProcessor processor = method.getResultProcessor().withDynamicProjection(accessor); final Class<?> typeToRead = getTypeToRead(processor); final ArangoCursor<?> result = operations.query(query, bindVars, options, typeToRead); logWarningsIfNecessary(result); return processor.processResult(convertResult(result, accessor)); }
protected Request queryRequest( final String query, final Map<String, Object> bindVars, final AqlQueryOptions options) { final AqlQueryOptions opt = options != null ? options : new AqlQueryOptions(); final Request request = request(name, RequestType.POST, PATH_API_CURSOR).setBody( util().serialize(OptionsBuilder.build(opt, query, bindVars != null ? util().serialize(bindVars, new ArangoSerializer.Options().serializeNullValues(true)) : null))); if (opt.getAllowDirtyRead() == Boolean.TRUE) { RequestUtils.allowDirtyRead(request); } return request; }
private ArangoCursor<?> _resolve(final String id, final Class<?> type, final boolean limit) { final String query = String.format("FOR e IN @@edge FILTER e._to == @id RETURN e", limit ? "LIMIT 1" : ""); return template.query(query, new MapBuilder().put("@edge", type).put("id", id).get(), new AqlQueryOptions(), type); }
final Boolean fullCount, final Boolean cache) { return new AqlQueryOptions().setCount(count).setBatchSize(batchSize).setFullCount(fullCount).setCache(cache);