I have a Java SE application where I can not use the @size annotation. This annotation is handled by org.hibernate.validator.Size.
It has a user field in the template in which I do this:
@Size(min = 1, max = 30)
@Column(name = "CAMPO")
private String campo;
When trying to save an object it accuses an InvalidStateException, saying that the value of the String field, which received the value "3216549", should have size between 1 and 30. But the value should pass through validation.
I tried to use @length and did not accuse this error any more. Does anyone have any idea what might be happening with @size? I have read in some places that it is more recommended than @length, for compatibility issues and wanted to use it.