Neo4j 4.2图形存储库保存方法现在存在歧义。

3

我刚刚从Spring Data Neo4j 4.1.3更新到了4.2.7

但是,在更改Maven依赖项后,我无法使我的项目重新运行起来。

我已经按照这个教程描述中的方法解决了很多问题:https://graphaware.com/neo4j/2016/09/30/upgrading-to-sdn-42.html 但我无法弄清楚为什么会出现这个问题。

在我的服务中 > GenericService.java > createOrUpdate

...
@Override
public T createOrUpdate(T entity) {
    getRepository().save(entity, DEPTH_ENTITY_NEXT); //ERROR LINE
    if (entity instanceof Entity)
        return find(((Entity) entity).getId());
    else if (entity instanceof GraphType)
        return find(((GraphType) entity).getId());
    else 
        return find(((DataType) entity).getId());
}
...

现在,getRepository代码行会出现以下错误:

The method save(T, int) is ambiguous for the type 
    GraphRepository<T>

仅仅保存图形库似乎出现错误。

更新

如果我尝试使用Maven构建项目,即使Eclipse显示错误,也会打印出这个错误:

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/data/neo4j/config/Neo4jConfiguration.class] cannot be opened because it does not exist
1个回答

2
您可能在依赖管理方面遇到了问题。 请参考模板,以获取有关如何配置项目的示例。
另外,请注意,GraphRepository已经被弃用,并被Neo4jRepository<T, ID>所取代。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接