@@ -187,16 +187,16 @@ private ArangoCollection _collection(final String name, final ArangoPersistentEn
187187
188188 private static void ensureCollectionIndexes (final CollectionOperations collection ,
189189 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 ));
200200 persistentEntity .getTtlIndex ().ifPresent (index -> ensureTtlIndex (collection , index ));
201201 persistentEntity .getTtlIndexedProperty ().ifPresent (p -> ensureTtlIndex (collection , p ));
202202 }
@@ -330,12 +330,6 @@ public DbName getDatabaseName() {
330330 : databaseName );
331331 }
332332
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-
339333 @ Override
340334 public <T > ArangoCursor <T > query (final String query , final Map <String , Object > bindVars ,
341335 final AqlQueryOptions options , final Class <T > entityClass ) throws DataAccessException {
@@ -481,7 +475,7 @@ public <T> Iterable<T> findAll(final Class<T> entityClass, DocumentReadOptions o
481475 }
482476
483477 @ 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 )
485479 throws DataAccessException {
486480 try {
487481 final Collection <String > keys = new ArrayList <>();
@@ -519,7 +513,7 @@ public DocumentEntity insert(final Object value, final DocumentCreateOptions opt
519513 try {
520514 result = _collection (value .getClass ()).insertDocument (toVPack (value ), options );
521515 } catch (final ArangoDBException e ) {
522- throw exceptionTranslator . translateExceptionIfPossible (e );
516+ throw translateExceptionIfPossible (e );
523517 }
524518
525519 updateDBFields (value , result );
@@ -536,7 +530,7 @@ public DocumentEntity insert(final String collectionName, final Object value, fi
536530 try {
537531 result = _collection (collectionName ).insertDocument (toVPack (value ), options );
538532 } catch (final ArangoDBException e ) {
539- throw exceptionTranslator . translateExceptionIfPossible (e );
533+ throw translateExceptionIfPossible (e );
540534 }
541535
542536 updateDBFields (value , result );
@@ -557,7 +551,7 @@ private Object getDocumentKey(final ArangoPersistentEntity<?> entity, final Obje
557551
558552 @ Override
559553 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 ();
561555 final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
562556
563557 final Object id = getDocumentKey (entity , value );
@@ -576,13 +570,13 @@ public <T> void upsert(final T value, final UpsertStrategy strategy) throws Data
576570 insert (value );
577571 }
578572
579- @ SuppressWarnings ("unchecked" )
580573 @ Override
581574 public <T > void upsert (final Iterable <T > value , final UpsertStrategy strategy ) throws DataAccessException {
582575 final Optional <T > first = StreamSupport .stream (value .spliterator (), false ).findFirst ();
583576 if (!first .isPresent ()) {
584577 return ;
585578 }
579+ @ SuppressWarnings ("unchecked" )
586580 final Class <T > entityClass = (Class <T >) first .get ().getClass ();
587581 final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
588582
@@ -630,7 +624,7 @@ public <T> void repsert(final T value, AqlQueryOptions options) throws DataAcces
630624 options , clazz
631625 ).first ();
632626 } catch (final ArangoDBException e ) {
633- throw exceptionTranslator . translateExceptionIfPossible (e );
627+ throw translateExceptionIfPossible (e );
634628 }
635629
636630 updateDBFieldsFromObject (value , result );
@@ -704,12 +698,12 @@ private <T> void updateDBFields(final Iterable<T> values, final MultiDocumentEnt
704698 final Iterator <T > valueIterator = values .iterator ();
705699 if (res .getErrors ().isEmpty ()) {
706700 final Iterator <? extends DocumentEntity > documentIterator = res .getDocuments ().iterator ();
707- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
701+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
708702 updateDBFields (valueIterator .next (), documentIterator .next ());
709703 }
710704 } else {
711705 final Iterator <Object > documentIterator = res .getDocumentsAndErrors ().iterator ();
712- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
706+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
713707 final Object nextDoc = documentIterator .next ();
714708 final Object nextValue = valueIterator .next ();
715709 if (nextDoc instanceof DocumentEntity ) {
@@ -751,7 +745,7 @@ public void dropDatabase() throws DataAccessException {
751745 }
752746 databaseCache .remove (db .name ());
753747 collectionCache .keySet ().stream ().filter (key -> key .getDb ().equals (db .name ()))
754- .forEach (key -> collectionCache . remove ( key ) );
748+ .forEach (collectionCache :: remove );
755749 }
756750
757751 @ Override
0 commit comments