Let's start with an example :
In my JPA entity
public class User {
    @Pattern("^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$", message="invalidEmailResourceBundleKey")
    private String email;
    @Min(5, message="minimumResourceBundleKey")
    private int age;
...
}
In my JSF Bean
public class UserBean {
    private User user;
    // do i have to redefine it here, since it's already a part of the user ?
    @@Pattern("^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$") 
    public String getEmail() {
        return user.getEmail();
    }
    public void setEmail(String s) {
        user.setEmail(s);
    }
    // do i have to redefine it here, since it's already a part of the user ?
    @Min(5, message="minimumResourceBundleKey")
    public int getAge() {
        return user.getAge();
    }
    public void setAge(int age) {
        user.setAge(age);
    }
}
Is it possible to reuse the the validations for the entities for the JSF beans that actually delegates the method calls to the entities, so that i dont have to redefine the bean validations on the JSF beans ?
Can i even extend the reusing to the level of the error message in resource bundle, and whether the message can be parameterized with {0} etc like the usual ? I wonder if there's any example on the web for this, since i've been unable to find none.
Please share your thoughts on this ..
Thank you !
 
     
    