@@ -187,16 +187,16 @@ private ArangoCollection _collection(final String name, final ArangoPersistentEn
187
187
188
188
private static void ensureCollectionIndexes (final CollectionOperations collection ,
189
189
final ArangoPersistentEntity <?> persistentEntity ) {
190
- persistentEntity .getHashIndexes ().stream (). forEach (index -> ensureHashIndex (collection , index ));
191
- persistentEntity .getHashIndexedProperties ().stream (). forEach (p -> ensureHashIndex (collection , p ));
192
- persistentEntity .getSkiplistIndexes ().stream (). forEach (index -> ensureSkiplistIndex (collection , index ));
193
- persistentEntity .getSkiplistIndexedProperties ().stream (). forEach (p -> ensureSkiplistIndex (collection , p ));
194
- persistentEntity .getPersistentIndexes ().stream (). forEach (index -> ensurePersistentIndex (collection , index ));
195
- persistentEntity .getPersistentIndexedProperties ().stream (). forEach (p -> ensurePersistentIndex (collection , p ));
196
- persistentEntity .getGeoIndexes ().stream (). forEach (index -> ensureGeoIndex (collection , index ));
197
- persistentEntity .getGeoIndexedProperties ().stream (). forEach (p -> ensureGeoIndex (collection , p ));
198
- persistentEntity .getFulltextIndexes ().stream (). forEach (index -> ensureFulltextIndex (collection , index ));
199
- persistentEntity .getFulltextIndexedProperties ().stream (). forEach (p -> ensureFulltextIndex (collection , p ));
190
+ persistentEntity .getHashIndexes ().forEach (index -> ensureHashIndex (collection , index ));
191
+ persistentEntity .getHashIndexedProperties ().forEach (p -> ensureHashIndex (collection , p ));
192
+ persistentEntity .getSkiplistIndexes ().forEach (index -> ensureSkiplistIndex (collection , index ));
193
+ persistentEntity .getSkiplistIndexedProperties ().forEach (p -> ensureSkiplistIndex (collection , p ));
194
+ persistentEntity .getPersistentIndexes ().forEach (index -> ensurePersistentIndex (collection , index ));
195
+ persistentEntity .getPersistentIndexedProperties ().forEach (p -> ensurePersistentIndex (collection , p ));
196
+ persistentEntity .getGeoIndexes ().forEach (index -> ensureGeoIndex (collection , index ));
197
+ persistentEntity .getGeoIndexedProperties ().forEach (p -> ensureGeoIndex (collection , p ));
198
+ persistentEntity .getFulltextIndexes ().forEach (index -> ensureFulltextIndex (collection , index ));
199
+ persistentEntity .getFulltextIndexedProperties ().forEach (p -> ensureFulltextIndex (collection , p ));
200
200
persistentEntity .getTtlIndex ().ifPresent (index -> ensureTtlIndex (collection , index ));
201
201
persistentEntity .getTtlIndexedProperty ().ifPresent (p -> ensureTtlIndex (collection , p ));
202
202
}
@@ -330,12 +330,6 @@ public DbName getDatabaseName() {
330
330
: databaseName );
331
331
}
332
332
333
- @ Override
334
- public <T > ArangoCursor <T > query (final String query , final AqlQueryOptions options , final Class <T > entityClass )
335
- throws DataAccessException {
336
- return query (query , null , options , entityClass );
337
- }
338
-
339
333
@ Override
340
334
public <T > ArangoCursor <T > query (final String query , final Map <String , Object > bindVars ,
341
335
final AqlQueryOptions options , final Class <T > entityClass ) throws DataAccessException {
@@ -481,7 +475,7 @@ public <T> Iterable<T> findAll(final Class<T> entityClass, DocumentReadOptions o
481
475
}
482
476
483
477
@ Override
484
- public <T > Iterable <T > find (final Iterable <? extends Object > ids , final Class <T > entityClass , DocumentReadOptions options )
478
+ public <T > Iterable <T > find (final Iterable <?> ids , final Class <T > entityClass , DocumentReadOptions options )
485
479
throws DataAccessException {
486
480
try {
487
481
final Collection <String > keys = new ArrayList <>();
@@ -519,7 +513,7 @@ public DocumentEntity insert(final Object value, final DocumentCreateOptions opt
519
513
try {
520
514
result = _collection (value .getClass ()).insertDocument (toVPack (value ), options );
521
515
} catch (final ArangoDBException e ) {
522
- throw exceptionTranslator . translateExceptionIfPossible (e );
516
+ throw translateExceptionIfPossible (e );
523
517
}
524
518
525
519
updateDBFields (value , result );
@@ -536,7 +530,7 @@ public DocumentEntity insert(final String collectionName, final Object value, fi
536
530
try {
537
531
result = _collection (collectionName ).insertDocument (toVPack (value ), options );
538
532
} catch (final ArangoDBException e ) {
539
- throw exceptionTranslator . translateExceptionIfPossible (e );
533
+ throw translateExceptionIfPossible (e );
540
534
}
541
535
542
536
updateDBFields (value , result );
@@ -557,7 +551,7 @@ private Object getDocumentKey(final ArangoPersistentEntity<?> entity, final Obje
557
551
558
552
@ Override
559
553
public <T > void upsert (final T value , final UpsertStrategy strategy ) throws DataAccessException {
560
- final Class <? extends Object > entityClass = value .getClass ();
554
+ final Class <?> entityClass = value .getClass ();
561
555
final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
562
556
563
557
final Object id = getDocumentKey (entity , value );
@@ -576,13 +570,13 @@ public <T> void upsert(final T value, final UpsertStrategy strategy) throws Data
576
570
insert (value );
577
571
}
578
572
579
- @ SuppressWarnings ("unchecked" )
580
573
@ Override
581
574
public <T > void upsert (final Iterable <T > value , final UpsertStrategy strategy ) throws DataAccessException {
582
575
final Optional <T > first = StreamSupport .stream (value .spliterator (), false ).findFirst ();
583
576
if (!first .isPresent ()) {
584
577
return ;
585
578
}
579
+ @ SuppressWarnings ("unchecked" )
586
580
final Class <T > entityClass = (Class <T >) first .get ().getClass ();
587
581
final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
588
582
@@ -630,7 +624,7 @@ public <T> void repsert(final T value, AqlQueryOptions options) throws DataAcces
630
624
options , clazz
631
625
).first ();
632
626
} catch (final ArangoDBException e ) {
633
- throw exceptionTranslator . translateExceptionIfPossible (e );
627
+ throw translateExceptionIfPossible (e );
634
628
}
635
629
636
630
updateDBFieldsFromObject (value , result );
@@ -704,12 +698,12 @@ private <T> void updateDBFields(final Iterable<T> values, final MultiDocumentEnt
704
698
final Iterator <T > valueIterator = values .iterator ();
705
699
if (res .getErrors ().isEmpty ()) {
706
700
final Iterator <? extends DocumentEntity > documentIterator = res .getDocuments ().iterator ();
707
- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
701
+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
708
702
updateDBFields (valueIterator .next (), documentIterator .next ());
709
703
}
710
704
} else {
711
705
final Iterator <Object > documentIterator = res .getDocumentsAndErrors ().iterator ();
712
- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
706
+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
713
707
final Object nextDoc = documentIterator .next ();
714
708
final Object nextValue = valueIterator .next ();
715
709
if (nextDoc instanceof DocumentEntity ) {
@@ -751,7 +745,7 @@ public void dropDatabase() throws DataAccessException {
751
745
}
752
746
databaseCache .remove (db .name ());
753
747
collectionCache .keySet ().stream ().filter (key -> key .getDb ().equals (db .name ()))
754
- .forEach (key -> collectionCache . remove ( key ) );
748
+ .forEach (collectionCache :: remove );
755
749
}
756
750
757
751
@ Override
0 commit comments