for this and will create a
PR for the change.
2013/11/26 Gunnar Morling <gunnar(a)hibernate.org>
Thoughts, anyone? Steve?
2013/11/21 Gunnar Morling <gunnar(a)hibernate.org>
> I'm working on supporting on the CouchDB backend for OGM, and more
> specifically on integrating the optimistic locking functionality which is
> built into CouchDB .
> For that purpose, each CouchDB document has a defined field "_rev" which
> is a UUID and is updated on the server-side upon each write. So I thought I
> could map this attribute like this:
> @Generated //this prop. needs to be read back value after writes
> @Version //this prop. is used for optimistic locking
> String _rev;
> But this gave me a CCE since @Version is not allowed on Strings
> (org.hibernate.type.StringType is no VersionType).
> Looking around, I found BinaryType which looks like what'd I need for
> Strings, there is also a note mentioning basically the same use case case
> . If I register a custom type derived from StringType with an equivalent
> implementation of the VersionType contract, I get the behavior I need.
> Does anyone see a problem with making o.h.t.String a VersionType in this
> way (i.e. it'd only support DB-generated values)?
>  https://hibernate.atlassian.net/browse/OGM-392
>  "only known application of binary types for versioning is for use
> with the TIMESTAMP datatype supported by Sybase and SQL Server, which are
> completely db-generated values"