This content has been marked as final.
Show 6 replies
-
1. Re: @NotNull ignored in booking demo
gavin.king Mar 8, 2006 11:02 AM (in response to tim.brewer)You should be using @Length(min=1)
-
2. Re: @NotNull ignored in booking demo
tim.brewer Mar 8, 2006 11:25 AM (in response to tim.brewer)Thanks, but I'm not sure that is an ideal solution. Consider the following code ...
@Column(name="EMAIL_ADDRESS") @NotNull(message="Email Address is required.") @Length(min=1, message="Email Address is required.") @Length(max=500, message="Email Address must be less than 500 characters long.")
The duplicate @Length annotation is not allowed, so I can't validate both the max length and the required conditions. -
3. Re: @NotNull ignored in booking demo
gavin.king Mar 8, 2006 6:07 PM (in response to tim.brewer)It is VERY easy to extend Hibernate Validator and add your own annotations :-)
-
4. Re: @NotNull ignored in booking demo
patrick_ibg Mar 8, 2006 6:19 PM (in response to tim.brewer)Can't you do:
@Length (min = 1, max = 500, message = "Email address must be between 1 and 500 characters long.") -
5. Re: @NotNull ignored in booking demo
gavin.king Mar 8, 2006 6:37 PM (in response to tim.brewer)@Length (min = 1, max = 500, message = "Email address is required and must be at most {max} characters long.")
-
6. Re: @NotNull ignored in booking demo
tim.brewer Mar 9, 2006 5:20 AM (in response to tim.brewer)k, thanks folks.
My choices are manipulate the code or the english language ;-)