It seems that what this user really needs is a way to convert the
Set<ConstraintViolation> into another format entirely, JSON in this case. I wonder
if we could find a more generic approach than just the ability to change properties names.
On 19 sept. 2013, at 09:05, Gunnar Morling <gunnar(a)hibernate.org> wrote:
On SO , a user asked whether it's possible to report custom names for
property constraint violations, e.g. "nm" as retrieved from the annotation
in this case:
final public String name;
At the moment that's not possible with HV, but one might think about a
contract similar to ParameterNameProvider which returns the reported names
for properties (or even custom names to be used instead of the constants
"<return-value>" and "<cross-parameter>").
It's the first time I came across this requirement but adding support for
this should not be too complex and it might be helpful to some. Any
hibernate-dev mailing list