I am struggling how to convert this example: https://spring.io/guides/gs/accessing-data-neo4j/ to work on new version of Spring Data. I obviously change imports for Person.java to org.neo4j.ogm.*. I have added:
@Bean
public SessionFactory getSessionFactory()
{
logger.info("ApplicationConfig::getSessionFactory()");
return new SessionFactory("hello");
}
@Bean
public Session getSession() throws Exception {
logger.info("Initialising Neo4jSession");
SessionFactory sessionFactory = getSessionFactory();
Assert.notNull(sessionFactory, "You must provide a SessionFactory instance in your Spring configuration classes");
return sessionFactory.openSession();
}
to Application.java file. But I don't know how to change method:
@Bean CommandLineRunner demo(PersonRepository personRepository, GraphDatabase graphDatabase)
to work. I have tried move code from this method to constructor of its class, but I need to have PersonRepository.