Ошибка в весенних данных neo4j образца при использовании GraphRepository
Привет, я скачал один пример кода для весенних данных neo4j. Я сталкиваюсь с ошибкой ниже, может кто-то помочь в этом.
Фрагмент кода:
public interface PersonRepository extends GraphRepository<Person> {
Person findByName(String name);
Iterable<Person> findByTeammatesName(String name);
}
Application.java
PersonRepository personRepository = ctx.getBean(PersonRepository.class);
GraphDatabase graphDatabase = ctx.getBean(GraphDatabase.class);
Transaction tx = graphDatabase.beginTx();
try {
personRepository.save(greg);
personRepository.save(roy);
personRepository.save(craig);
greg = personRepository.findByName("Greg");
//......
for (String name: new String[]{greg.name, roy.name, craig.name}) {
System.out.println(personRepository.findByName(name));
Ошибка:
The return types are incompatible for the inherited methods PagingAndSortingRepository<Person,Long>.findAll(Sort), CRUDRepository<Person>.findAll(Sort) PersonRepository.java /SpringDataForNeo4j/src line 5 Java Problem
The return types are incompatible for the inherited methods Repository<Person,Long>.count(), CRUDRepository<Person>.count() PersonRepository.java /SpringDataForNeo4j/src line 5 Java Problem
The return types are incompatible for the inherited methods Repository<Person,Long>.findAll(), CRUDRepository<Person>.findAll() PersonRepository.java /SpringDataForNeo4j/src line 5 Java Problem
Может кто-нибудь помочь мне решить эту проблему, пожалуйста.
1 ответ
Я решил эту проблему путем обновления этих jar-файлов: (spring-data-commons иspring-data-commons-core) до их последней версии. В любом случае я думаю, что это проблема библиотеки. Перейдите по http://mvnrepository.com/artifact/org.springframework.data чтобы получить последние банки.