我正在使用Neo4j数据库和spring-data-neo4j。现在,我想导入相当大的数据集,因此我研究了neo4j的批处理插入功能。
经过我的研究,我发现:
BatchInserter:http://docs.neo4j.org/chunked/stable/batchinsert.html和使用它的Michael项目:https://github.com/jexp/batch-import/现在,我想知道是否可以在批处理插入中使用spring-data-neo4j的存储库特性,因为即使是AbstractGraphRepository中的方法save(Iterable<U> entities)也只是遍历每个元素并为一个实体调用save:
@Override
@Transactional
public <U extends T> Iterable<U> save(Iterable<U> entities) {
for (U entity : entities) {
save(entity);
}
return entities;
}发布于 2014-03-13 06:10:26
目前还没有对批量插入的官方支持。
但是你可以尝试这样的方法:http://code.paananen.fi/2012/04/05/neo4j-batchinserter-and-spring-data-for-neo4j/
不过,它使用的是SDN版本的pre3.0
https://stackoverflow.com/questions/22362892
复制相似问题