hibernate/hibernate-ogm — pull request #263 by gunnarmorling (2013-12-12 14:10:26+00:00)
Title: OGM-392 PREVIEW - Support for CouchDB's optimistic locking

Hi, this PR is not for inclusion yet, I'm creating it yet to get early feedback, in case someone is in review mode :) It's based on the one for OGM-389, so only the last two commits are new.

What has changed:

* There is support for ORM's `@Generated` annotation; This will cause the property's entity to be read back after writes, refreshing the property value
* `OgmCollectionPersister` initiates the re-reading of an entity which stores embedded association information upon updating the association.
The rationale is that CouchDB can store association information within entity documents, changing such a documents revision on the server side when updating the association. Thus that entity's revision needs to be refreshed after assocation update. For that purpose I've added a new method to `GridDialect` which is invoked by the persister to find out whether that refresh is required or not.
* (temporarily) Introduced `CouchDBStringType` since ORM's own string type isn't a `VersionType` which it needs to be though. I haven't yet come to sending a PR to ORM which changes that.