(Quick Reference)

1 Introduction - Reference Documentation

Authors: Stefan Armbruster

Version: 1.0.0

1 Introduction

Neo4j is (as of now) the only graph database that fits nicely in a Grails application.

The goal of this grails-data-mapping subproject is to provide a 'as-complete-as-possible' GORM implemenatition that maps domain classes and instances to the Neo4j nodespace. The following features are supported:

  • Marshalling from Neo4j nodespace to Groovy/Java types and back again
  • Support for GORM dynamic finders, criteria and named queries
  • Session-managed transactions
  • Validating domain instances
  • access to Neo4j's traversal capabilities
  • access the Neo4j graph database in all flavours (Embedded, REST and HA)
  • using Neo4j autoindexing

1.1 Compatibility with GORM for Hibernate

This implementation tries to be as compatible as possible with GORM for Hibernate. In general you can refer to the GORM documentation and the "Domain Classes" section of the reference guide (see the left nav) for usage information.

The following key features are supported by GORM for Neo4j:

  • Simple persistence methods
  • Dynamic finders
  • Criteria queries
  • Named queries
  • Inheritance
  • Embedded types
  • Query by example
  • Many-to-many associations (these can be modelled with a mapping class)

However, some features are not supported:

  • HQL queries
  • Dirty checking methods
  • Composite primary keys
  • Any direct interaction with the Hibernate API
  • Custom Hibernate user types

There may be other limitations not mentioned here so in general it shouldn't be expected that an application based on GORM for Hibernate will "just work" without some tweaking involved. Having said that, the large majority of common GORM functionality is supported.

1.2 Release Notes

Below are the details of the changes across releases:


  • works with Neo4j HA
  • implementing new GORM property criteria filters
  • uses Neo4j 1.8.2


  • first GORM compliant version of the plugin
  • works with embedded and REST Neo4j databases
  • exposing traversal options to domain classes

up to 0.3.1

  • uses non GORM compliant implementation.