(Quick Reference)

2 Getting Started - Reference Documentation

Authors: Graeme Rocher

Version: 5.0.0.BUILD-SNAPSHOT

2 Getting Started

Checking out and Building

The project is currently hosted on Github at .

You are free to fork the project from there or clone it anonymously using git:

git clone git@github.com:SpringSource/grails-data-mapping.git
cd grails-data-mapping

The project has a Gradle build. You can generate Eclipse or Intellij project files to open the project using:

./gradlew eclipse

Or

./gradlew idea

Once this is done your can import the project into Eclipse, or in the case of Intellij open up the generated grails-data-mapping.ipr file.

The version of Gradle used has a bug whereby a subproject is generated for the root directory called "grails-data-mapping". You should remove this subproject from your Intellij Modules or delete it it from Eclipse.

To build the project you can run the assemble task:

./gradlew assemble

To install the jar files for the various subprojects into your local Maven repository you can run:

./gradlew install

To build all of the documentation run the command:

./gradlew allDocs

Documentation will produced in the build/docs directory.

If you experience PermGen errors when building documentation you may need to increase the JVM permgen inside GRADLE_OPTS

Project Structure

The project is essentially a multi-project Gradle build. There is a core API and then subprojects that implement that API. The core API subprojects include:

  • grails-datastore-core - The core API, this provides core interfaces for implementing a GORM provider
  • grails-datastore-gorm - The runtime meta-programming and AST transformation infrastructure behind GORM. Also provides end users APIs like grails.gorm.CriteriaBuilder and grails.gorm.DetachedCriteria
  • grails-datastore-gorm-plugin-support - Support classes for easing the writing of a GORM plugin for Grails
  • grails-datastore-gorm-tck - The TCK that includes hundreds of Spock specifications that a GORM implementation will need to pass
  • grails-datastore-web - Classes required to integrate GORM into a web tier

Beyond these core subprojects there are implementations for various datastores. For example:

  • grails-datastore-gemfire/grails-datastore-gorm-gemfire - GORM for Gemfire project
  • grails-datastore-jpa/grails-datastore-gorm-jpa - GORM for JPA project
  • grails-datastore-mongo/grails-datastore-gorm-mongo - GORM for MongoDB project
  • grails-datastore-neo4j - GORM for Neo4j project
  • grails-datastore-redis/grails-datastore-gorm-redis - GORM for Redis project
  • grails-datastore-riak/grails-datastore-gorm-riak - GORM for Riak project
  • grails-datastore-simpledb/grails-datastore-gorm-simpledb - GORM for SimpleDB project

Some implementations are split into 2 subprojects others are not. It depends whether the author chooses to divide the Java parts and the Groovy parts of the project implementation. It is not a requirement to do so.

The documentation for each implementation is kept in the documentation subprojects that start with grails-documentation. There are documentation projects for the core API, MongoDB, Neo4j, Redis, Riak and Amazon SimpleDB.

Finally the Grails plugins that are used to distribute the GORM implementations to end users can be found in the grails-plugins directory.