http://docs.spring.io/spring-data/mongodb/docs/1.5.4.RELEASE/reference/html/mapping-chapter.html
6.3.1 Mapping annotation overview
The MappingMongoConverter can use metadata to drive the mapping of objects to documents. An overview of the annotations is provided below
- @Id - applied at the field level to mark the field used for identiy purpose.
- @Document - applied at the class level to indicate this class is a candidate for mapping to the database. You can specify the name of the collection where the database will be stored. @Document(collection = "collectionName")
- @DBRef - applied at the field to indicate it is to be stored using a com.mongodb.DBRef.
- @Indexed - applied at the field level to describe how to index the field.