I am trying to create a custom validator for variable \'amount\' in my domain class, such that the new value should be greater than previous by 0.50.
For example, l
You can try reading domainEntity.getPersistentValue('amount').
EDIT: ... in custom validator, like:
class Bid {
Double amount
...
static constraints = { amount(validator: { double a, Bid b ->
def oldValue = b.getPersistentValue('amount')
a > oldValue + 0.5 ? true : "Amount $a should be at least ${oldValue + 0.5}" })
}
}