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 Full definition for data model (opens in a new tab)The 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 Full definition for Cypher (opens in a new tab)Neo4j'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. Full definition for node (opens in a new tab)A vertex in a graph. In a property graph it can carry labels and properties. become annotated classes, Full definition for relationship (opens in a new tab)A 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 Full definition for traversal (opens in a new tab)Following 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 Full definition for pattern (opens in a new tab)A graph structure written in Cypher, such as a node joined to another node by a relationship. 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 Full definition for Cypher (opens in a new tab)Neo4j'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 Full definition for node (opens in a new tab)A 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 Full definition for relationship (opens in a new tab)A named, directed connection between two nodes. Every relationship has a type, a start node and an end node. between entities, storing Full definition for property (opens in a new tab)A 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 Full definition for Cypher (opens in a new tab)Neo4j'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 Full definition for projection (opens in a new tab)An 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 Full definition for Cypher (opens in a new tab)Neo4j'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, Full definition for aggregation (opens in a new tab)Grouping rows and computing a value over each group. In Cypher the grouping keys are whatever expressions in the same clause are not aggregated., 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 Full definition for pattern (opens in a new tab)A graph structure written in Cypher, such as a node joined to another node by a relationship. you apply here.