Spring Data Neo4j Distribution

Within the Spring Data project the Spring Data Neo4j library provides integration with the Neo4j graph database, offering object graph mapping, a Neo4jTemplate and Spring-Data-Commons Repository implementations.

License

License

Categories

Categories

Neo4J Data Databases
GroupId

GroupId

org.springframework.data
ArtifactId

ArtifactId

spring-data-neo4j-dist
Last Version

Last Version

2.1.0.RELEASE
Release Date

Release Date

Type

Type

pom
Description

Description

Spring Data Neo4j Distribution
Within the Spring Data project the Spring Data Neo4j library provides integration with the Neo4j graph database, offering object graph mapping, a Neo4jTemplate and Spring-Data-Commons Repository implementations.
Project URL

Project URL

http://www.springsource.org/spring-data/neo4j
Project Organization

Project Organization

SpringSource
Source Code Management

Source Code Management

http://github.com/SpringSource/spring-data-neo4j

Download spring-data-neo4j-dist

How to add to project

<!-- https://jarcasting.com/artifacts/org.springframework.data/spring-data-neo4j-dist/ -->
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-neo4j-dist</artifactId>
    <version>2.1.0.RELEASE</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.springframework.data/spring-data-neo4j-dist/
implementation 'org.springframework.data:spring-data-neo4j-dist:2.1.0.RELEASE'
// https://jarcasting.com/artifacts/org.springframework.data/spring-data-neo4j-dist/
implementation ("org.springframework.data:spring-data-neo4j-dist:2.1.0.RELEASE")
'org.springframework.data:spring-data-neo4j-dist:pom:2.1.0.RELEASE'
<dependency org="org.springframework.data" name="spring-data-neo4j-dist" rev="2.1.0.RELEASE">
  <artifact name="spring-data-neo4j-dist" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.springframework.data', module='spring-data-neo4j-dist', version='2.1.0.RELEASE')
)
libraryDependencies += "org.springframework.data" % "spring-data-neo4j-dist" % "2.1.0.RELEASE"
[org.springframework.data/spring-data-neo4j-dist "2.1.0.RELEASE"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • spring-data-neo4j-parent
  • spring-data-neo4j
  • spring-data-neo4j-rest
  • spring-data-neo4j-tx
  • spring-data-neo4j-aspects
  • spring-data-neo4j-cross-store

Spring Data Neo4j Spring Data Neo4j

Spring Data Neo4j icon?job=spring data neo4j%2Fmaster&subject=Build Gitter

Spring Data Neo4j - or in short SDN - is an ongoing effort to create the next generation of Spring Data Neo4j, with full reactive support and lightweight mapping. SDN will work with immutable entities, regardless whether written in Java or Kotlin.

The primary goal of the Spring Data project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.

The SDN project aims to provide a familiar and consistent Spring-based programming model for integrating with the Neo4j Graph Database.

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Manual

For a gentle introduction and some getting started guides, please use our Manual.

Getting Started

Maven configuration

With Spring Boot

If you are on Spring Boot, all you have to do is to add our starter:

<dependency>
	<groupId>org.springframework.data</groupId>
	<artifactId>spring-boot-starter-data-neo4j</artifactId>
	<version>6.0.0</version>
</dependency>

and configure your database connection:

spring.neo4j.uri=bolt://localhost:7687
spring.neo4j.authentication.username=neo4j
spring.neo4j.authentication.password=secret

Please have a look at our manual for an overview about the architecture, how to define mappings and more.

Without Spring Boot

If you are using a plain Spring Framework project without Spring Boot, please add this Maven dependency:

<dependency>
	<groupId>{springGroupId}</groupId>
	<artifactId>spring-data-neo4j</artifactId>
	<version>6.0.0</version>
</dependency>

and configure SDN for reactive database access like this:

@Configuration
@EnableReactiveNeo4jRepositories
@EnableTransactionManagement
class MyConfiguration extends AbstractReactiveNeo4jConfig {

    @Bean
    public Driver driver() {
        return GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "secret"));
    }

    @Override
    protected Collection<String> getMappingBasePackages() {
        return Collections.singletonList(Person.class.getPackage().getName());
    }
}

The imperative version looks pretty much the same but uses EnableNeo4jRepositories and AbstractNeo4jConfig.

Important
We recommend Spring Boot, the automatic configuration and especially the dependency management through the Starters in contrast to the manual work of managing dependencies and configuration.

Here is a quick teaser of a reactive application using Spring Data Repositories in Java:

@Node
public class Person {
    private Long id;
    private String name;

    public Person(String name) {
        this.name = name;
    }
}

@Repository
interface PersonRepository extends ReactiveNeo4jRepository<Person, Long> {

    Flux<Person> findAllByName(String name);

    Flux<Person> findAllByNameLike(String name);
}

@Service
class MyService {

    @Autowired
    private final PersonRepository repository;

    @Transactional
    public Flux<Person> doWork() {

        Person emil = new Person("Emil");
        Person gerrit = new Person("Gerrit");
        Person michael = new Person("Michael");

        // Persist entities and relationships to graph database
        return repository.saveAll(Flux.just(emil, gerrit, michael));
    }
}

Building SDN

Please have a look at the documentation: Building SDN.

Getting Help

Having trouble with Spring Data? We’d love to help!

Reporting Issues

Spring Data uses JIRA as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:

  • Before you log a bug, please search the issue tracker to see if someone has already reported the problem.

  • If the issue doesn’t already exist, create a new issue.

  • Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.

  • If you need to paste code, or include a stack trace use JIRA {code}…{code} escapes before and after your text.

  • If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.

License

Spring Data Neo4j is Open Source software released under the Apache 2.0 license.

org.springframework.data

Versions

Version
2.1.0.RELEASE
2.0.2.RELEASE
2.0.1.RELEASE
2.0.0.RELEASE