PlayMorphia features
PlayMorphia is a Object-MongoDB mapping layer to help Play application developers easily access MongoDB. PlayMorphia provides powerful yet simple enough interfaces and facilities to address nearly all aspect for application to access MongoDB:
- Object-BSON mapping. Map between Java POJO object and MongoDB BSON format data. See PlayMorphia model.
- Support embedded and reference relationship between models
- Transparent GridFS support for Blob fields
- Automatic create and update timestamp
- Support arbitrary ID type
- Creating index with annotations
- Super powerful and easy query interface
- Support atomic update operations
- Complete aggregation and group aggregation support
- Sophisticated Model entity lifecycle event handling framework
- Play!Framework integration
play.db.Model
support. The PlayMorphia model class extendsplay.db.Model
class and you get all most everything you can get from Play’s JPA model facilities. Actually you get more in PlayMorphia- CRUD support. PlayMorphia model support most CRUD operations transparently
- Data binding and validation. You can continue enjoy Play’s automatic data binding mechansim when you are working with PlayMorphia
- Fixtures. You can use Play’s Fixture to load yaml data into your MongoDB. However you need to use MorphiaFixture to delete data
play.data.validation.Unique
support (start from v1.2.7). Now you can annotate your field with@Unique
and Play’s validation framework will verify your data is unique in this field.