Category Archives: No SQL Databases

Configuring Spring Boot with Neo4j

Neo4j is an open-source, NoSQL, native graph database that provides an ACID-compliant tx backend for your applications.In this short tutorial we will learn how to configure it to work with Spring Boot.

In order to create a template for a Web application using Neo4j and Spring Boot, you can bootstrap your project as follows:

$ spring init -dweb,data-neo4j -artifactId data-neo4j-demo

Next, add in application.properties the configuration for Neo4j as in this example:

spring.data.neo4j.uri=http://server:7474 spring.data.neo4j.username=neo4j spring.data.neo4j.password=admin

Next, you need to design your Repository classes so that it extends org.springframework.data.neo4j.repository.GraphRepository:

import org.springframework.data.neo4j.repository.GraphRepository;   public interface CustomerRepository extends GraphRepository<Customer> { ... }