Building Neo4j Applications with Spring Data
Master Spring Data Neo4j: map your graph to Java domain classes, build repositories and controllers, and query Neo4j with derived methods and Cypher.
In this 4-hour course, you will learn
Spring Data Neo4j brings the graph database into the Spring ecosystem you already know. In this course, you learn how to build a Spring Boot application backed by Neo4j: you map a graph data modelThe labels, relationship types and properties chosen to represent a domain. to Java domain classes, create repositories and controllers to read and write data, and drop down to custom CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. when the derived methods do not cover what you need.
If you have used Spring Data with a relational database, the shape of the library will feel familiar — entities, repositories, and annotations — but the mapping is different in ways that matter. NodesA vertex in a graph. In a property graph it can carry labels and properties. become annotated classes, relationshipsA named, directed connection between two nodes. Every relationship has a type, a start node and an end node. become object references or dedicated relationship-property classes, and the queries Spring generates for you traverseFollowing relationships from one node to the next to reach other parts of a graph. a graph rather than join tables. This course teaches you both the familiar patterns and the graph-specific decisions, using a movie dataset that grows into a working REST API.
Spring Data Neo4j Library
Understand how Spring Data Neo4j integrates with the Neo4j Java Driver to let you interact with a graph database using familiar Spring patterns and annotations.
Mapping a Graph Data Model
Learn to annotate Java domain classes with Spring Data Neo4j to accurately represent nodes, relationships, and properties from a graph data model.
Converting Data Types
Apply custom converters to transform Neo4j property types, such as dates and enums, into the correct Java types within your domain model.
Reading and Writing Data
Build Spring Data repositories and use derived query methods to read and persist graph data without writing boilerplate data-access code.
Using Custom Cypher
Write custom Cypher queries with the @Query annotation to express traversals and aggregations that derived query methods cannot produce.
6 modules, 4 hours.
Who this course is for
Java developers who want to use Neo4j as the database behind a Spring Boot application: backend developers adding graph capabilities to an existing Spring project, teams evaluating Spring Data Neo4j as their data access layer, and developers who know the Neo4j Java driver and want the higher-level mapping and repositories the library provides. You should be able to write Java programs, have a working understanding of Spring Boot and Spring Data, and be comfortable with the basics of Neo4j and CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. first — the prerequisite courses are listed beside this overview. No previous experience with Spring Data Neo4j is required, and the course provides a ready-to-use development environment so you can start without installing anything.
What you'll build and do
Across five hands-on modules and a set of graded challenges, you build the data access layer for a movie application step by step. You configure a Spring Boot project to connect to a Neo4j database, annotate
MovieandPersonclasses so Spring Data Neo4j can map them to nodesA vertex in a graph. In a property graph it can carry labels and properties. in the graph, and expose them through repository and controller classes that serve real HTTP endpoints.You then work with the parts of the model that make graphs different: mapping relationshipsA named, directed connection between two nodes. Every relationship has a type, a start node and an end node. between entities, storing propertiesA named value stored on a node or a relationship. on the relationships themselves, and recognizing modeling situations where a naive mapping loads far more of the graph than you intend. On the write side, you create, update, and delete nodes through the repository's
saveanddeleteByIdmethods. Finally, you write your own CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. with the@Queryannotation and trim responses with interface-based and DTO-based projectionsAn in-memory copy of part of your database that graph algorithms run against. You choose which nodes and relationships it holds..Where to go next
If you want to understand what Spring Data Neo4j is doing under the hood, Using Neo4j with Java teaches the official Java driver directly. To improve the custom CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. you write in your
@Queryannotations, Intermediate Cypher Queries covers filtering, aggregation, and query tuning in depth. This course also counts toward your preparation for the Neo4j Certified Professional exam, which validates your knowledge of Neo4j fundamentals, Cypher, and the data modeling patterns you apply here.