All posts in Trimm Mongo

The first Maven snapshot of TRIMM 1.0.1 with TrimmMongo is available from our Maven Repository.

The TrimmMongo project has in this first version a Listener (dk.tigerteam.trimm.mdsd.mongo.SpringDataMongoGeneratorListener) that based on stereotypes can use Spring Data Mongo mapping annotation to save your model in MongDB instance.

There’s also an TrimmMongo example project available called TrimmMongoExample

Short introduction to TrimmMongo modeling

In this first version of the SpringDataMongoGeneratorListener there is support for following annotations for mappings of objects to documents. The listener Stereotypes and Tag values to drive the mapping metadata:

  • @Id – applied at the field level to mark the field used for identiy purpose. STEREOTYPE: DOCUMENT_ID
  • @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. STEREOTYPE: DOCUMENT
  • @DBRef – applied at the field to indicate it is to be stored using a com.mongodb.DBRef. STEREOTYPE: DBREF
  • @Indexed – applied at the field level to describe how to index the field. STEREOTYPE: INDEX & UNIQUEINDEX
  • @Transient – by default all private fields are mapped to the document, this annotation excludes the field where it is applied from being stored in the database STEREOTYPE: TRANSIENT

Read more