This chapter is an introduction to graph databases, Neo4j, and the Neo4j object-graph mapping library (Neo4j-OGM). It also outlines requirements and where to get support.

If you are already familiar with Neo4j and Neo4j-OGM, feel free to jump directly to the tutorial or reference sections.

1. What’s new in Neo4j-OGM 3 ?

At a high level, here is what has changed in this third major version of Neo4j-OGM :

  • Simplified and less intrusive development model

    Technical database ids were previously required in the domain model ; this is no more the case. Ids can now be of any simple type, and generated using pluggable strategies. To avoid confusion about where to place annotations, they are now only valid on class attributes. See :/reference/index.adoc#reference:annotating-entities:entity-identifier and Migration from 2.1 to 3.0/3.1 for more details.

  • Dynamic properties

    This long awaited feature allows you to map node properties to dynamic structures (java maps). See Dynamic properties.

  • Improved performance

    Retrieving data is more performant in Neo4j-OGM 3, particularly for deep depths, because querying leverages annotation information expressed in the domain model. This allows to build smarter queries, and only fetch useful mappable data.

  • More flexible configuration

    OGM 3 offers rich configuration possibilities detailed here.

  • New baselines

    The minimum required versions are Java 8 and Neo4j 3.1.

  • Better integration with various execution environments

    Internally, Neo4j-OGM 3 relies on FastClasspathScanner which allows more reliable entity bytecode scanning, as well as better support application servers (like JBoss).

Check the migration checklist when upgrading from Neo4j-OGM 2.1

2. Requirements

Neo4j-OGM 3.2.x at minimum, requires:

  • JDK Version 8 and above.

  • Neo4j Database 3.2.x and above.

3. Additional Resources

3.1. Project metadata

3.2. Getting Help or providing feedback

If you encounter issues or you are just looking for advice, feel free to use one of the links below:

3.2.1. Learning more

The jumping off ground for learning about Neo4j is Here is a list of other useful resources:

4. What is an OGM?

An OGM (Object Graph Mapper) maps nodes and relationships in the graph to objects and references in a domain model. Object instances are mapped to nodes while object references are mapped using relationships, or serialized to properties. JVM primitives are mapped to node or relationship properties. An OGM abstracts the database and provides a convenient way to persist your domain model in the graph and query it without using low level drivers. It also provides the flexibility to the developer to supply custom queries where the queries generated by Neo4j-OGM are insufficient.

4.1. Introducing the Neo4j-OGM

Developing Java Business Applications often requires mapping rich domain models to your database. The Neo4j-OGM library is a pure Java library that can persist (annotated) domain objects using Neo4j. It uses Cypher statements to handle those operations in Neo4j.

Neo4j-OGM supports tracking changes to minimize necessary updates and transitive persistence (reading and updating neighborhoods of an object).

The connection to Neo4j handled by a transport mode layer called driver, which can use the binary protocol, HTTP or Neo4j’s embedded APIs.