Can I rename of the "version" field? (GORM MongoDB + Grails 2.2)
I've got a domain object that already has a property called versions, so
I'd like to give a different name to the built-in version property (used
in GORM for optimistic locking). For instance, I'd like to call it
updateCount instead.
Note that I do want the semantics of optimistic locking; I just want to
give the field another name. Here's what I've naively tried (and it didn't
work):
class Item {
ObjectId id
static hasMany = [versions: ItemVersion]
static mapping = {
table 'item'
version column: 'updateCount' // <-- This was my attempt
}
}
I would definitely appreciate any help in...
Determining whether this is possible, and
If so, making it work :-)
Thanks!