graphaware / neo4j-framework

GraphAware Neo4j Framework
244 stars 68 forks source link

Allow IterableBatchTransactionExecutor to handle ResourceIterator<Node> #18

Closed ikwattro closed 9 years ago

ikwattro commented 9 years ago

Currently, we have to use GlobalGraphOperations in order to use the IterableBatchTransactionExecutor from the framework.

The GGO is deprecated and thus I think it would be nice to support the new database methods that returns ResourceIterator<Node> or ResourceIterator<Relationship>

bachmanm commented 9 years ago

In latest version, you'll be able to pass in an Iterator as well. Just be careful, the arguments come in a different order (quickfix because of java type erasure). So you now have:

public IterableInputBatchTransactionExecutor(GraphDatabaseService database, int batchSize, final TransactionCallback<Iterable<T>> callback, UnitOfWork<T> unitOfWork)

and

public IterableInputBatchTransactionExecutor(GraphDatabaseService database, int batchSize, UnitOfWork<T> unitOfWork, final TransactionCallback<Iterator<T>> callback)