Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage Guides Good Relationships

Good Relationships


With Spring Data, the ever popular Spring Framework has cultivated a new patch of ground, bringing Big Data and NOSQL technology like Neo4j to enterprise developers. This guide introduces you to Spring Data Neo4j, using the fast, powerful and scalable graph database Neo4j to enjoy the benefits of having good relationships in your data.

Written by the project lead, Good Relationships provides all the practical details you need for developing enterprise applications with Spring Data Neo4j. The book starts with a narrative tutorial about implementing, a full social web-app for movie enthusiasts. Then, a thorough reference part details core Neo4j concepts, querying, and the simple annotated POJO programming model of Spring Data Neo4j.

Free download



Buy the print version for $ 9.95

If you enjoyed reading the free download version, please support the author and InfoQ's book series by purchasing the print version.

Table of Contents

Foreword by Rod Johnson
Foreword by Emil Eifrem

About this guide book

  • The Spring Data Neo4j Project
  • Feedback
  • Format of the Book
  • Acknowledgements

I. Tutorial

  • Introducing our project
  • The Spring stack
  • Required setup 
  • The domain model
  • Learning Neo4j
  • Spring Data Neo4j
  • Annotating the domain
  • Indexing
  • Repositories
  • Relationships
  •     Creating relationships
        Accessing related entities
        Accessing the relationship entities
  • Get it running
  •     Populating the database
        Inspecting the datastore
                 Neoclipse visualization
                 The Neo4j Shell
  • Web views
  •      Searching
         Listing results
  • Adding social
  •      Users
         Ratings for movies
  • Adding Security
  • More UI
  • Importing Data
  • Recommendations
  • Neo4j Server
  •      Getting Neo4j-Server
         Other approaches
  • Conclusion

II. Reference Documentation

  • Reference Documentation
  •      Spring Data and Spring Data Neo4j
         Reference Documentation Overview
  • Introduction to Neo4j
  •      What is a graph database?
         About Neo4j
         Creating nodes and relationships
         Graph traversal
         Querying the Graph with Cypher
         Gremlin a Graph Traversal DSL
  • Programming model
  •      Object Graph Mapping
         Advanced Mapping with AspectJ
                 AspectJ IDE support
         Simple Object Graph Mapping
         Defining node entities
                 @NodeEntity: The basic building block
                 @GraphId: Neo4j -id field
                 @GraphProperty: Optional annotation for property fields
                 @Indexed: Making entities searchable by field value
                 @Query: fields as query result views
                 @GraphTraversal: fields as traversal result views
         Relating node entities
                 @RelatedTo: Connecting node entities
                 @RelationshipEntity: Rich relationships
                 @RelatedToVia: Accessing relationship entities
                 Exact and numeric index
                 Fulltext indexes
                 Manual index access
                 Index queries in Neo4jTemplate
                 Neo4j Auto Indexes
                 Spatial Indexes
                 Basic operations
                 Graph traversal
                 Cypher Queries
                 Gremlin Scripts
                 Neo4j REST Server
         CRUD with repositories
                 IndexRepository and NamedIndexRepository
                 Query and Finder Methods
                 CypherDSL repository
                 Creating repositories
                 Composing repositories
         Projecting entities
         Geospatial Queries
         Active Record Methods for Advanced Mapping Mode
         Detached node entities in advanced mapping mode
                 Relating detached entities
         Entity type representation
         Bean validation (JSR-303)
  • Environment setup
  •      Dependencies for Spring Data Neo4j Simple Mapping
         Gradle configuration for Advanced Mapping (AspectJ)
         Ant/Ivy configuration for Advanced Mapping (AspectJ)
         Maven configuration for Advanced Mapping
                 Maven AspectJ build configuration
         Spring configuration 
                 XML namespace
                 Repository Configuration 
                 Java-based bean configuration 
  • Cross-store persistence
  •      Partial entities 
         Cross-store annotations 
                 @NodeEntity(partial = "true") 
         Configuring cross-store persistence 
  • Sample code
  •      Introduction 
         Hello Worlds sample application 
         IMDB sample application 
         MyRestaurants sample application 
         MyRestaurant-Social sample application 
         Cineasts social movie database 
  • Heroku: Seeding the Cloud
  •      Create a Self-Hosted Web Application 
         Deploy to Heroku 
  • Performance considerations 
         When to use Spring Data Neo4j 
  • AspectJ details
  • Neo4j Server
  •      Server Extension 
         Using Spring Data Neo4j as a REST client