[hibernate-dev] i18n and cascade validation

Mihai Cazacu cazacugmihai at gmail.com
Wed Feb 13 09:12:59 EST 2013


Hi,

I have this classes:

class Address {
>
    @NotEmpty(message = "{address.notEmpy}")

    String body
> }





class Contact {
>     Address address
> }



class Person {
>     Contact contact
>     Address address
> }


Is there a way to obtain different messages when the "address.body" is null
in both Person and Contact?
Right now I've got:

ConstraintViolationImpl{interpolatedMessage='may not be empty',
> propertyPath=contact.address.body, rootBeanClass=class Person,
> messageTemplate='{address.notEmpy}'}
> ConstraintViolationImpl{interpolatedMessage='may not be empty',
> propertyPath=address.body, rootBeanClass=class Person,
> messageTemplate='{address.notEmpy}'}


Thanks!
Mihai


More information about the hibernate-dev mailing list