2017-09-25 25 views
3

我刚刚从春节数据的Neo4j 4.1.3更新4.2.7的Neo4j 4.2图形回购保存方法是现在暧昧

但是,我一直没能得到我的项目开始改变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> 

只节省图形回购似乎示数。

UPDATE

如果我只是尝试Maven构建项目,即使月食显示错误。它打印此错误:

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

回答

2

您的依赖管理中可能有问题。 有关如何配置项目的示例,请参阅templates。请注意,GraphRepository已弃用,由Neo4jRepository<T, ID>替代。