springboot2.2使用neo4j
第一次更新先放一些代码进来,下次加注释
1.引入相应的包
org.springframework.boot
spring-boot-starter-data-neo4j
2.配置neo4j
spring.data.neo4j.uri=bolt://localhost:7687
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=admin
@Bean
public org.neo4j.ogm.config.Configuration getConfiguration(){
org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration.Builder()
.uri(environment.getProperty("spring.data.neo4j.uri"))
.connectionPoolSize(100)
.credentials(environment.getProperty("spring.data.neo4j.username"), environment.getProperty("spring.data.neo4j.password"))
.withBasePackages("com.distribute.order.repository")
.build();
return configuration;
}
@Bean
public SessionFactory se