2017-09-25 42 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>替代。