what's the status on this? any chance to get something done in this area for BV1.1?
I'd really like be able to have cross-field validation annotations on property level rather than solely on class level. Consider the following example, which is really ugly in my opinion if implemented on bean level:
Consider @Max would be a binary constraint, allowing to reference another property that provides the maximum value. This is what I would like to do:
public class Bean {
privateint a;
@Max("#{a}") // or maybe another notation to reference properties, e.g. simply "a"privateint b;
...
}
Implementing this on bean level is really ugly, isn't it?:
@Max(target = "#{b}", value="#{a}")
public class Bean {
privateint a;
privateint b;
}
I know, using @ScriptAssert might make the second version more readable, however, it's the same issue if you have large beans with more cross-level constraints. IMO @Max("#{a}") is not only the most readable but also much more consistent with the unary @Max constraint.
what's the status on this? any chance to get something done in this area for BV1.1?
I'd really like be able to have cross-field validation annotations on property level rather than solely on class level. Consider the following example, which is really ugly in my opinion if implemented on bean level:
Consider @Max would be a binary constraint, allowing to reference another property that provides the maximum value. This is what I would like to do:
Implementing this on bean level is really ugly, isn't it?:
I know, using @ScriptAssert might make the second version more readable, however, it's the same issue if you have large beans with more cross-level constraints. IMO @Max("#{a}") is not only the most readable but also much more consistent with the unary @Max constraint.