Introduction
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.
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 layer is based on the Bolt protocol and uses the Neo4j Java Driver.
What’s new in Neo4j-OGM 4 ?
At a high level, here is what has changed in this third major version of Neo4j-OGM :
-
New baselines
The minimum required versions are Java 17 and Neo4j 5.x.
-
Removal of Auto Index Manager
The Auto Index Manager that was responsible for creating indexes and constraints out-of-the-box got removed from the Neo4j-OGM.
Please use tools like Neo4j-Migrations or Liquibase with the Neo4j-Plugin enabled to control your schema. They offer a broader feature set than just focus on indexes and constraints.
Although the functionality was removed, the interfaces are still available. Those are currently in place to avoid refactoring your codebase and support Neo4j-Migrations' annotation processor to make the transition easier.
-
Removal of HTTP and embedded transport support
Since Neo4j 4.x Neo4j-OGM did not offer embedded transport but the module was still available for users connecting to a 3.5.x instance. Because the baseline of the official supported database was raised to Neo4j 5.x with this release, the embedded option got deprecated.
The HTTP transport mode was removed because it was rarely used and could not compete with the broad feature set that Bolt allows you to have.
Additional Resources
Project metadata
-
Version control - https://github.com/neo4j/neo4j-ogm
-
Bug tracker - https://github.com/neo4j/neo4j-ogm/issues
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:
-
For more detailed questions, use our community platform or Neo4j-OGM on StackOverflow.
-
Use the https://github.com/neo4j/neo4j-ogm for reporting issues.
Learning more
The jumping off ground for learning about Neo4j is neo4j.com. Here is a list of other useful resources:
-
The Neo4j documentation introduces Neo4j and contains links to getting started guides, reference documentation and tutorials.
-
The online sandbox provides a convenient way to interact with a Neo4j instance in combination with the online tutorial.
-
Neo4j Java Bolt Driver.