This content has been marked as final.
Show 5 replies
-
1. Re: @Length throws InvalidStateException when String is null
ellenzhao Jun 26, 2007 4:31 PM (in response to pettersonfp)@Column(name="aColumn", nullable=true)
@Length(min=3, max=30)
public SomeType getSomething(){
return this.something;
} -
2. Re: @Length throws InvalidStateException when String is null
pettersonfp Jun 26, 2007 4:33 PM (in response to pettersonfp)Unfortunatelly the property is already annotated with @Column(nullable=true) as well.
-
3. Re: @Length throws InvalidStateException when String is null
pmuir Jun 27, 2007 5:39 AM (in response to pettersonfp)Don't set the min property. If a field is null then it isn't the minimum length ;)
-
4. Re: @Length throws InvalidStateException when String is null
pmuir Jun 27, 2007 5:40 AM (in response to pettersonfp)Hibernate validators are really easy to write - you could write your own @length that counts a null as a valid value.
-
5. Re: @Length throws InvalidStateException when String is null
pettersonfp Jun 27, 2007 7:21 AM (in response to pettersonfp)Hi Peter,
Thanks, I´ll do that.