32
32
import com .arangodb .entity .AqlFunctionsEntity ;
33
33
import com .arangodb .entity .ArangoUnixTime ;
34
34
import com .arangodb .entity .ArangoVersion ;
35
+ import com .arangodb .entity .BaseCursorEntity ;
35
36
import com .arangodb .entity .BaseDocument ;
36
37
import com .arangodb .entity .BatchResponseEntity ;
37
38
import com .arangodb .entity .BooleanResultEntity ;
38
39
import com .arangodb .entity .CollectionEntity ;
40
+ import com .arangodb .entity .CollectionKeyOption ;
39
41
import com .arangodb .entity .CollectionOptions ;
40
42
import com .arangodb .entity .CollectionsEntity ;
41
43
import com .arangodb .entity .CursorEntity ;
42
44
import com .arangodb .entity .DatabaseEntity ;
43
45
import com .arangodb .entity .DefaultEntity ;
44
46
import com .arangodb .entity .DeletedEntity ;
45
- import com .arangodb .entity .DocumentCursorEntity ;
46
47
import com .arangodb .entity .DocumentEntity ;
47
48
import com .arangodb .entity .DocumentResultEntity ;
48
49
import com .arangodb .entity .EdgeDefinitionEntity ;
@@ -2262,8 +2263,7 @@ public <T> CursorResultSet<T> executeQueryWithResultSet(
2262
2263
* if set to true the result count is returned
2263
2264
* @param batchSize
2264
2265
* the batch size of the result cursor
2265
- * @param <T>
2266
- * @return <T> CursorResultSet<T>
2266
+ * @return CursorResultSet<T>
2267
2267
* @throws ArangoException
2268
2268
* @Deprecated As of release 2.5.4, replaced by
2269
2269
* {@link #executeDocumentQuery()}
@@ -2286,10 +2286,10 @@ public <T> CursorResultSet<T> executeQueryWithResultSet(
2286
2286
*
2287
2287
* @param query
2288
2288
* an AQL query as string
2289
- * @return CursorDocumentEntity< ?>
2289
+ * @return BaseCursorEntity<?, ?>
2290
2290
* @throws ArangoException
2291
2291
*/
2292
- public DocumentCursorEntity < ?> validateDocumentQuery (String query ) throws ArangoException {
2292
+ public BaseCursorEntity <?, ?> validateDocumentQuery (String query ) throws ArangoException {
2293
2293
return cursorDocumentDriver .validateQuery (getDefaultDatabase (), query );
2294
2294
}
2295
2295
@@ -2310,49 +2310,20 @@ public DocumentCursorEntity<?> validateDocumentQuery(String query) throws Arango
2310
2310
* @param fullCount
2311
2311
* if set to true, then all results before the final LIMIT will
2312
2312
* be counted
2313
- * @param <T>
2314
- * @return <T> CursorDocumentEntity<T>
2313
+ * @return BaseCursorEntity<T, S>
2315
2314
* @throws ArangoException
2316
2315
*/
2317
- public <T > DocumentCursorEntity < T > executeCursorDocumentEntityQuery (
2316
+ public <T , S extends DocumentEntity < T >> BaseCursorEntity < T , S > executeCursorDocumentEntityQuery (
2318
2317
String query ,
2319
2318
Map <String , Object > bindVars ,
2319
+ Class <S > classDocumentEntity ,
2320
2320
Class <T > clazz ,
2321
2321
Boolean calcCount ,
2322
2322
Integer batchSize ,
2323
2323
Boolean fullCount ) throws ArangoException {
2324
2324
2325
- return cursorDocumentDriver .executeQuery (getDefaultDatabase (), query , bindVars , clazz , calcCount , batchSize ,
2326
- fullCount );
2327
- }
2328
-
2329
- /**
2330
- * This method executes an AQL query and returns a CursorDocumentEntity
2331
- *
2332
- * @param query
2333
- * an AQL query as string
2334
- * @param bindVars
2335
- * a map containing all bind variables,
2336
- * @param clazz
2337
- * the expected class, the result from the server request is
2338
- * deserialized to an instance of this class.
2339
- * @param calcCount
2340
- * if set to true the result count is returned
2341
- * @param batchSize
2342
- * the batch size of the result cursor
2343
- * @param <T>
2344
- * @return <T> CursorDocumentEntity<T>
2345
- * @throws ArangoException
2346
- */
2347
- public <T > DocumentCursorEntity <T > executeCursorDocumentEntityQuery (
2348
- String query ,
2349
- Map <String , Object > bindVars ,
2350
- Class <T > clazz ,
2351
- Boolean calcCount ,
2352
- Integer batchSize ) throws ArangoException {
2353
-
2354
- return cursorDocumentDriver .executeQuery (getDefaultDatabase (), query , bindVars , clazz , calcCount , batchSize ,
2355
- false );
2325
+ return cursorDocumentDriver .executeBaseCursorEntityQuery (getDefaultDatabase (), query , bindVars ,
2326
+ classDocumentEntity , clazz , calcCount , batchSize , fullCount );
2356
2327
}
2357
2328
2358
2329
/**
@@ -2363,13 +2334,15 @@ public <T> DocumentCursorEntity<T> executeCursorDocumentEntityQuery(
2363
2334
* @param clazz
2364
2335
* the expected class, the result from the server request is
2365
2336
* deserialized to an instance of this class.
2366
- * @param <T>
2367
- * @return <T> CursorDocumentEntity<T>
2337
+ * @return BaseCursorEntity<T, S>
2368
2338
* @throws ArangoException
2369
2339
*/
2370
- public <T > DocumentCursorEntity <T > continueCursorDocumentEntityQuery (long cursorId , Class <?>... clazz )
2371
- throws ArangoException {
2372
- return cursorDocumentDriver .continueQuery (getDefaultDatabase (), cursorId , clazz );
2340
+ public <T , S extends DocumentEntity <T >> BaseCursorEntity <T , S > continueBaseCursorEntityQuery (
2341
+ long cursorId ,
2342
+ Class <S > classDocumentEntity ,
2343
+ Class <T > clazz ) throws ArangoException {
2344
+ return cursorDocumentDriver .continueBaseCursorEntityQuery (getDefaultDatabase (), cursorId , classDocumentEntity ,
2345
+ clazz );
2373
2346
}
2374
2347
2375
2348
/**
@@ -2401,8 +2374,7 @@ public DefaultEntity finishCursorDocumentEntityQuery(long cursorId) throws Arang
2401
2374
* @param fullCount
2402
2375
* if set to true, then all results before the final LIMIT will
2403
2376
* be counted
2404
- * @param <T>
2405
- * @return <T> CursorDocumentResultSet<T>
2377
+ * @return DocumentCursor<T>
2406
2378
* @throws ArangoException
2407
2379
*/
2408
2380
public <T > DocumentCursor <T > executeDocumentQuery (
@@ -2413,8 +2385,9 @@ public <T> DocumentCursor<T> executeDocumentQuery(
2413
2385
Integer batchSize ,
2414
2386
Boolean fullCount ) throws ArangoException {
2415
2387
2416
- return cursorDocumentDriver .executeQueryWithResultSet (getDefaultDatabase (), query , bindVars , clazz , calcCount ,
2417
- batchSize , fullCount );
2388
+ BaseCursor <T , DocumentEntity <T >> baseCursor = cursorDocumentDriver .executeBaseCursorQuery (query , query ,
2389
+ bindVars , DocumentEntity .class , clazz , calcCount , batchSize , fullCount );
2390
+ return new DocumentCursor <T >(baseCursor );
2418
2391
}
2419
2392
2420
2393
/**
@@ -2431,8 +2404,7 @@ public <T> DocumentCursor<T> executeDocumentQuery(
2431
2404
* if set to true the result count is returned
2432
2405
* @param batchSize
2433
2406
* the batch size of the result cursor
2434
- * @param <T>
2435
- * @return <T> CursorDocumentResultSet<T>
2407
+ * @return CursorDocumentResultSet<T>
2436
2408
* @throws ArangoException
2437
2409
*/
2438
2410
public <T > DocumentCursor <T > executeDocumentQuery (
@@ -2442,8 +2414,38 @@ public <T> DocumentCursor<T> executeDocumentQuery(
2442
2414
Boolean calcCount ,
2443
2415
Integer batchSize ) throws ArangoException {
2444
2416
2445
- return cursorDocumentDriver .executeQueryWithResultSet (getDefaultDatabase (), query , bindVars , clazz , calcCount ,
2446
- batchSize , false );
2417
+ BaseCursor <T , DocumentEntity <T >> baseCursor = cursorDocumentDriver .executeBaseCursorQuery (query , query ,
2418
+ bindVars , DocumentEntity .class , clazz , calcCount , batchSize , false );
2419
+ return new DocumentCursor <T >(baseCursor );
2420
+ }
2421
+
2422
+ /**
2423
+ * This method executes an AQL query and returns a CursorDocumentResultSet
2424
+ *
2425
+ * @param query
2426
+ * an AQL query as string
2427
+ * @param bindVars
2428
+ * a map containing all bind variables,
2429
+ * @param clazz
2430
+ * the expected class, the result from the server request is
2431
+ * deserialized to an instance of this class.
2432
+ * @param calcCount
2433
+ * if set to true the result count is returned
2434
+ * @param batchSize
2435
+ * the batch size of the result cursor
2436
+ * @return BaseCursor<T, S>
2437
+ * @throws ArangoException
2438
+ */
2439
+ public <T , S extends DocumentEntity <T >> BaseCursor <T , S > executeBaseCursorQuery (
2440
+ String query ,
2441
+ Map <String , Object > bindVars ,
2442
+ Class <S > classDocumentEntity ,
2443
+ Class <T > clazz ,
2444
+ Boolean calcCount ,
2445
+ Integer batchSize ) throws ArangoException {
2446
+
2447
+ return cursorDocumentDriver .executeBaseCursorQuery (getDefaultDatabase (), query , bindVars , classDocumentEntity ,
2448
+ clazz , calcCount , batchSize , false );
2447
2449
}
2448
2450
2449
2451
/**
0 commit comments