Neo4j 4.2 graph repo 保存方法现在不明确
Neo4j 4.2 graph repo save method is now ambiguous
我刚刚从 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>
简单地保存 graph repo 似乎是错误的。
更新
如果我只是尝试使用 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
你的依赖管理可能有问题。
有关如何配置项目的示例,请参阅 templates。
另请注意,GraphRepository
已弃用并由 Neo4jRepository<T, ID>
取代。
我刚刚从 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>
简单地保存 graph repo 似乎是错误的。
更新
如果我只是尝试使用 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
你的依赖管理可能有问题。 有关如何配置项目的示例,请参阅 templates。
另请注意,GraphRepository
已弃用并由 Neo4jRepository<T, ID>
取代。