@@ -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 }
@@ -324,12 +324,6 @@ public DbName getDatabaseName() {
324324 : databaseName );
325325 }
326326
327- @ Override
328- public <T > ArangoCursor <T > query (final String query , final AqlQueryOptions options , final Class <T > entityClass )
329- throws DataAccessException {
330- return query (query , null , options , entityClass );
331- }
332-
333327 @ Override
334328 public <T > ArangoCursor <T > query (final String query , final Map <String , Object > bindVars ,
335329 final AqlQueryOptions options , final Class <T > entityClass ) throws DataAccessException {
@@ -475,7 +469,7 @@ public <T> Iterable<T> findAll(final Class<T> entityClass, DocumentReadOptions o
475469 }
476470
477471 @ Override
478- public <T > Iterable <T > find (final Iterable <? extends Object > ids , final Class <T > entityClass , DocumentReadOptions options )
472+ public <T > Iterable <T > find (final Iterable <?> ids , final Class <T > entityClass , DocumentReadOptions options )
479473 throws DataAccessException {
480474 try {
481475 final Collection <String > keys = new ArrayList <>();
@@ -513,7 +507,7 @@ public DocumentEntity insert(final Object value, final DocumentCreateOptions opt
513507 try {
514508 result = _collection (value .getClass ()).insertDocument (toVPack (value ), options );
515509 } catch (final ArangoDBException e ) {
516- throw exceptionTranslator . translateExceptionIfPossible (e );
510+ throw translateExceptionIfPossible (e );
517511 }
518512
519513 updateDBFields (value , result );
@@ -530,7 +524,7 @@ public DocumentEntity insert(final String collectionName, final Object value, fi
530524 try {
531525 result = _collection (collectionName ).insertDocument (toVPack (value ), options );
532526 } catch (final ArangoDBException e ) {
533- throw exceptionTranslator . translateExceptionIfPossible (e );
527+ throw translateExceptionIfPossible (e );
534528 }
535529
536530 updateDBFields (value , result );
@@ -551,7 +545,7 @@ private Object getDocumentKey(final ArangoPersistentEntity<?> entity, final Obje
551545
552546 @ Override
553547 public <T > void upsert (final T value , final UpsertStrategy strategy ) throws DataAccessException {
554- final Class <? extends Object > entityClass = value .getClass ();
548+ final Class <?> entityClass = value .getClass ();
555549 final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
556550
557551 final Object id = getDocumentKey (entity , value );
@@ -570,13 +564,13 @@ public <T> void upsert(final T value, final UpsertStrategy strategy) throws Data
570564 insert (value );
571565 }
572566
573- @ SuppressWarnings ("unchecked" )
574567 @ Override
575568 public <T > void upsert (final Iterable <T > value , final UpsertStrategy strategy ) throws DataAccessException {
576569 final Optional <T > first = StreamSupport .stream (value .spliterator (), false ).findFirst ();
577570 if (!first .isPresent ()) {
578571 return ;
579572 }
573+ @ SuppressWarnings ("unchecked" )
580574 final Class <T > entityClass = (Class <T >) first .get ().getClass ();
581575 final ArangoPersistentEntity <?> entity = getConverter ().getMappingContext ().getPersistentEntity (entityClass );
582576
@@ -624,7 +618,7 @@ public <T> void repsert(final T value, AqlQueryOptions options) throws DataAcces
624618 options , clazz
625619 ).first ();
626620 } catch (final ArangoDBException e ) {
627- throw exceptionTranslator . translateExceptionIfPossible (e );
621+ throw translateExceptionIfPossible (e );
628622 }
629623
630624 updateDBFieldsFromObject (value , result );
@@ -698,12 +692,12 @@ private <T> void updateDBFields(final Iterable<T> values, final MultiDocumentEnt
698692 final Iterator <T > valueIterator = values .iterator ();
699693 if (res .getErrors ().isEmpty ()) {
700694 final Iterator <? extends DocumentEntity > documentIterator = res .getDocuments ().iterator ();
701- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
695+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
702696 updateDBFields (valueIterator .next (), documentIterator .next ());
703697 }
704698 } else {
705699 final Iterator <Object > documentIterator = res .getDocumentsAndErrors ().iterator ();
706- for (; valueIterator .hasNext () && documentIterator .hasNext (); ) {
700+ while ( valueIterator .hasNext () && documentIterator .hasNext ()) {
707701 final Object nextDoc = documentIterator .next ();
708702 final Object nextValue = valueIterator .next ();
709703 if (nextDoc instanceof DocumentEntity ) {
@@ -745,7 +739,7 @@ public void dropDatabase() throws DataAccessException {
745739 }
746740 databaseCache .remove (db .name ());
747741 collectionCache .keySet ().stream ().filter (key -> key .getDb ().equals (db .name ()))
748- .forEach (key -> collectionCache . remove ( key ) );
742+ .forEach (collectionCache :: remove );
749743 }
750744
751745 @ Override
0 commit comments