Skip to content

Commit 9354a9f

Browse files
committed
reverted to driver version 7.1.0
1 parent db359f7 commit 9354a9f

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
<dependency>
276276
<groupId>com.arangodb</groupId>
277277
<artifactId>arangodb-java-driver</artifactId>
278-
<version>7.2.0-SNAPSHOT</version>
278+
<version>7.1.0</version>
279279
</dependency>
280280
</dependencies>
281281
</dependencyManagement>

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

+24
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@
2626
import com.arangodb.entity.CursorWarning;
2727
import com.arangodb.springframework.core.mapping.event.AfterLoadEvent;
2828
import com.arangodb.springframework.core.mapping.event.ArangoMappingEvent;
29+
import org.slf4j.LoggerFactory;
2930
import org.springframework.context.ApplicationEventPublisher;
3031

3132
import java.io.IOException;
33+
import java.util.ArrayList;
3234
import java.util.Collection;
35+
import java.util.List;
3336
import java.util.function.Function;
37+
import java.util.stream.Stream;
38+
import java.util.stream.StreamSupport;
3439

3540
/**
3641
* @author Mark Vollmary
@@ -78,6 +83,20 @@ public boolean isCached() {
7883
return delegate.isCached();
7984
}
8085

86+
@Override
87+
public List<T> asListRemaining() {
88+
final List<T> remaining = new ArrayList<>();
89+
while (hasNext()) {
90+
remaining.add(next());
91+
}
92+
try {
93+
close();
94+
} catch (final Exception e) {
95+
LoggerFactory.getLogger(ArangoExtCursor.class).warn("Could not close cursor: ", e);
96+
}
97+
return remaining;
98+
}
99+
81100
@Override
82101
public boolean isPotentialDirtyRead() {
83102
return delegate.isPotentialDirtyRead();
@@ -93,6 +112,11 @@ public ArangoIterator<T> iterator() {
93112
return this;
94113
}
95114

115+
@Override
116+
public Stream<T> stream() {
117+
return StreamSupport.stream(spliterator(), false);
118+
}
119+
96120
@Override
97121
public void close() throws IOException {
98122
delegate.close();

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

+9-4
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteAll(
304304

305305
MultiDocumentEntity<DocumentDeleteEntity<T>> result;
306306
try {
307-
result = _collection(entityClass).deleteDocuments(values, options, entityClass);
307+
result = _collection(entityClass).deleteDocuments(toList(values), options, entityClass);
308308
} catch (final ArangoDBException e) {
309309
throw DataAccessUtils.translateIfNecessary(e, exceptionTranslator);
310310
}
@@ -355,7 +355,7 @@ public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateAll(
355355

356356
MultiDocumentEntity<DocumentUpdateEntity<T>> result;
357357
try {
358-
result = _collection(entityClass).updateDocuments(values, options, entityClass);
358+
result = _collection(entityClass).updateDocuments(toList(values), options, entityClass);
359359
} catch (final ArangoDBException e) {
360360
throw DataAccessUtils.translateIfNecessary(e, exceptionTranslator);
361361
}
@@ -408,7 +408,7 @@ public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceAll(
408408

409409
MultiDocumentEntity<DocumentUpdateEntity<T>> result;
410410
try {
411-
result = _collection(entityClass).replaceDocuments(values, options, entityClass);
411+
result = _collection(entityClass).replaceDocuments(toList(values), options, entityClass);
412412
} catch (final ArangoDBException e) {
413413
throw DataAccessUtils.translateIfNecessary(e, exceptionTranslator);
414414
}
@@ -501,7 +501,7 @@ public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertAll(
501501

502502
MultiDocumentEntity<DocumentCreateEntity<T>> result;
503503
try {
504-
result = _collection(entityClass).insertDocuments(values, options, entityClass);
504+
result = _collection(entityClass).insertDocuments(toList(values), options, entityClass);
505505
} catch (final ArangoDBException e) {
506506
throw DataAccessUtils.translateIfNecessary(e, exceptionTranslator);
507507
}
@@ -783,4 +783,9 @@ public ResolverFactory getResolverFactory() {
783783
return this.resolverFactory;
784784
}
785785

786+
private <T> List<T> toList(Iterable<T> it) {
787+
ArrayList<T> l = new ArrayList<>();
788+
it.forEach(l::add);
789+
return l;
790+
}
786791
}

0 commit comments

Comments
 (0)