can I override a jsr-303 validation annotation

后端 未结 3 1237
不思量自难忘°
不思量自难忘° 2020-12-06 11:39

I have a test like below:

public class TestSizeAnnotation
{
    public static void main(String[] args)
    {
        System.out.println(Validation.buildDefau         


        
3条回答
  •  萌比男神i
    2020-12-06 12:00

    You can ovveride an annotation configured validation via xml configuration:

    http://docs.jboss.org/hibernate/validator/4.2/reference/en-US/html_single/#validator-xmlconfiguration

    In your case, if you declare a different validation (or no validation) for the getList() methid in the validation.xml file, it will override the @Size annotation.

提交回复
热议问题