Reputation: 2202
I am currently running my webapp with an embedded neo4j. Now I want to change to a standalone neo4j server. While looking into working with the standalone server I stumbled over spring-data-neo4j. Having worked with spring-data-jpa and remembering how easy it was to connect to a db I started looking for a good tutorial how to work with spring-data-neo4j.
It seems possible with spring-data-neo4j-rest. That leaves the question how to configure it with java config, not with xml.
The spring data neo4j doc doesn't provide any infos on that.
Upvotes: 2
Views: 2707
Reputation: 41706
You just have to implement a config class that creates a SpringRestGraphDatabase
with your URL.
Something like:
@Configuration
@EnableNeo4jRepositories(basePackages = "org.springframework.data.neo4j.repository")
static class Config extends Neo4jConfiguration {
@Bean
public GraphDatabaseService graphDatabaseService() {
return new SpringRestGraphDatabase("http://localhost:7474/db/data/");
}
}
Upvotes: 10