Skip to content

Commit 25ff886

Browse files
committed
arangodb#80 minor code improvements
1 parent 952c325 commit 25ff886

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/main/java/com/arangodb/springframework/core/ArangoOperations.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,24 @@ default <T> ArangoCursor<T> query(String query, Map<String, Object> bindVars, Cl
9393
}
9494

9595
/**
96-
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor} instance for the
97-
* result list.
96+
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor}
97+
* instance for the result list.
9898
*
9999
* @param query
100100
* An AQL query string
101-
* @param options
102-
* Additional options that will be passed to the query API, can be null
103101
* @param entityClass
104102
* The entity type of the result
105103
* @return cursor of the results
106104
* @throws DataAccessException
107105
*/
108-
<T> ArangoCursor<T> query(String query, AqlQueryOptions options, Class<T> entityClass) throws DataAccessException;
106+
default <T> ArangoCursor<T> query(String query, AqlQueryOptions options, Class<T> entityClass)
107+
throws DataAccessException {
108+
return query(query, null, options, entityClass);
109+
}
109110

110111
/**
111-
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor} instance for the
112-
* result list.
112+
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor}
113+
* instance for the result list.
113114
*
114115
* @param query
115116
* An AQL query string

src/main/java/com/arangodb/springframework/core/template/ArangoTemplate.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,6 @@ public DbName getDatabaseName() {
283283
: databaseName);
284284
}
285285

286-
@Override
287-
public <T> ArangoCursor<T> query(final String query, final AqlQueryOptions options, final Class<T> entityClass)
288-
throws DataAccessException {
289-
return query(query, null, options, entityClass);
290-
}
291-
292286
@Override
293287
public <T> ArangoCursor<T> query(final String query, final Map<String, Object> bindVars,
294288
final AqlQueryOptions options, final Class<T> entityClass) throws DataAccessException {

src/main/java/com/arangodb/springframework/repository/query/AbstractArangoQuery.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ public Object execute(final Object[] parameters) {
7878
options.fullCount(true);
7979
}
8080

81-
final QueryWithCollections queryAndCollection = createQuery(accessor, bindVars, options);
81+
final QueryWithCollections query = createQuery(accessor, bindVars, options);
8282
if (options.getStreamTransactionId() == null && transactionBridge != null) {
83-
options.streamTransactionId(transactionBridge.getCurrentTransaction(queryAndCollection.getCollections()));
83+
options.streamTransactionId(transactionBridge.getCurrentTransaction(query.getCollections()));
8484
}
8585

8686

8787
final ResultProcessor processor = method.getResultProcessor().withDynamicProjection(accessor);
8888
final Class<?> typeToRead = getTypeToRead(processor);
8989

90-
final ArangoCursor<?> result = operations.query(queryAndCollection.getQuery(), bindVars, options, typeToRead);
90+
final ArangoCursor<?> result = operations.query(query.getQuery(), bindVars, options, typeToRead);
9191
logWarningsIfNecessary(result);
9292
return processor.processResult(convertResult(result, accessor));
9393
}

0 commit comments

Comments
 (0)