2
我使用Neo4j
数据库,其中spring-data-neo4j
。现在,我想导入非常大的数据集,因此我研究了批量插入的neo4j
的功能。Neo4j和spring-data-neo4j - 导入大型数据集
我的研究后,我发现了:
BatchInserter
嵌入式数据库:http://docs.neo4j.org/chunked/stable/batchinsert.html和迈克尔饥饿项目使用它:https://github.com/jexp/batch-import/- REST批量端点:http://docs.neo4j.org/chunked/stable/rest-api-batch-ops.html它允许在单个请求发送多个操作(所以多个操作在一个事务中执行)。
现在,我想知道是否有可能以某种方式使用spring-data-neo4j
批量插入存储库功能,因为即使是方法save(Iterable<U> entities)
在AbstractGraphRepository
刚刚经历的每一个元素进行迭代,并调用save
为一个实体:
@Override
@Transactional
public <U extends T> Iterable<U> save(Iterable<U> entities) {
for (U entity : entities) {
save(entity);
}
return entities;
}