MongoDB bridges the gap between key-value stores (which are fast and highly scalable) and traditional RDBMS systems (which provide rich queries and deep functionality).MongoDB (from "humongous") is a scalable, high-performance, open source, document-oriented database.This project aims to provide an object-mapping layer on top of Mongo to ease common activities such as:
- Marshalling from Mongo to Groovy/Java types and back again
- Support for GORM dynamic finders, criteria and named queries
- Session-managed transactions
- Validating domain instances backed by the Mongo datastore
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 Mongo:
- Simple persistence methods
- Dynamic finders
- Criteria queries
- Named queries
- Inheritance
- Embedded types
- Query by example
However, some features are not supported:
- HQL queries
- Dirty checking methods
- Composite primary keys
- Many-to-many associations (these can be modelled with a mapping class)
- 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.
Below are the details of the changes across releases:1.0 Milestone 5
- Remaining GORM events (beforeLoad, afterLoad)
- Optimistic locking via versioning
- Services can now be made transactional for Mongo only via transactional = "mongo"
1.0 Milestone 4
- Bug fixes and minor improvements
1.0 Milestone 3
- Bug fixes and minor improvements
1.0 Milestone 2
Features added in 1.0 Milestone 2:
- Embedded types
- Support for Maps and Lists
- Geospacial Indexing
- Schemaless Domain Models (Dynamic Attributes)
- Custom Index Attributes
1.0 Milestone 1
Features added in 1.0 Milestone 1:
- Dynamic finders
- Criteria queries
- Named queries
- Support for GMongo as a lower level API