persistence
persistence copied to clipboard
@NotNull, @NotEmpty, @NotBlank from Bean Validation
In #614 we said that @Nonnull should imply optional=false.
I guess I had sorta assumed that we already said something similar about the Bean Validation annotations, since back in the day, the interop with the persistence spec was one of the main reasons for creating that spec. (It grew out of Hibernate Validator.)
But in fact, it looks like we don't say much about these annotations.
-
Hibernate takes
@NotNull,@NotEmpty, and@NotBlankas implyingoptional=false. -
It also considers
@Min,@Max,@Size, and@Digitswhen generating DDL column lengths.
It's probably worth mentioning at least something about this in the spec and javadoc.