简体   繁体   English

Neo4j 4.2图形回购保存方法现在含糊不清

[英]Neo4j 4.2 graph repo save method is now ambiguous

I have just updated from Spring Data Neo4j 4.1.3 to 4.2.7 我刚刚从Spring Data Neo4j 4.1.3更新到4.2.7

But, I have not been able to get my project to start running again after changing the maven dependency. 但是,在更改maven依赖关系之后,我无法让我的项目再次开始运行。

I have fixed many issues as described in this tutorial: https://graphaware.com/neo4j/2016/09/30/upgrading-to-sdn-42.html But I cannot figure out why this issue has emerged. 我修复了本教程中描述的许多问题: https//graphaware.com/neo4j/2016/09/30/upgrading-to-sdn-42.html但我无法弄清楚为什么会出现这个问题。

In my service > GenericService.java > createOrUpdate 在我的服务> 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());
}
...

The getRepository line now gives the following error: getRepository行现在给出以下错误:

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

simply saving the graph repo seems to be erroring. 只是保存图表repo似乎是错误的。

UPDATE UPDATE

If I just try to Maven build the project even though eclipse shows the error. 如果我只是尝试Maven构建项目,即使eclipse显示错误。 It prints this error: 它打印出这个错误:

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

You probably have a problem in your dependency management. 您可能在依赖关系管理中遇到问题。 Please see the templates for examples on how to configure your project. 有关如何配置项目的示例,请参阅模板

Also note that GraphRepository is deprecated and replaced by Neo4jRepository<T, ID> . 另请注意,不推荐使用GraphRepository ,并将其替换为Neo4jRepository<T, ID>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM