This is a more basic design question with reference to the direction Hiberate is going.
Hibernate annotations define @Column with length and nullable
Hibernate validator defines @Length, @Max, @NotNull
According to the docs...
"Out of the box, Hibernate Annotations will translate the constraints you have defined for your entities into mapping metadata. For example, if a property of your entity is annotated @NotNull, its columns will be declared as not null in the DDL schema generated by Hibernate."
So, from the perspective of the schema, does it matter whether you use @Column.length or @Length to annotate your field? What if you declare both? (I do realize that @Length enables you to use the validator framework (in classes or view). Is one decision better than the other?
|