hibernate/hibernate-ogm — pull request #378 by gunnarmorling (2014-09-18 09:58:53+00:00)
Title: PREVIEW: OGM-526 - Map MongoDB object ids via IDENTITY strategy

@emmanuelbernard, @DavideD: Can you give me some quick feedback on this one.

The change brings support for MongoDB's `ObjectId`. It is supported to map it as `String` and Mongo's own `ObjectId` Java type.

When using identity strategy AUTO or INSERT, a value will be generated by the dialect upon insertion, so one round-trip to the datastore is saved. For that purpose I created another dialect facet, `IdentityColumnAwareGridDialect` which defines the operations required for the identity generation strategy. I also had to rip some pieces out of `EntityDehydrator` and move them into a new class `EntityAssociationUpdater`. The reason being, that we used to update the inverse side of bi-di associations *before* inserting the tuple on the main side. Of course this doesn't fly when generating the tuple id only during insert.

Thanks for any input!