> Truncating / validating string length
"Miguel Valdes Faura" wrote:
String length validation operation is available in Hibernate Validator through java annotations. Indeed, there is no equivalent mecanism in JPA to do that (planed for 2.0) but we can either use the Hibernate Validator as a entity listener in any JPA provider or either create a customize JPA entity listener that check this out.
instead of introducing a new library dependency for that, i would prefer that we add this truncation/validation in the code ourselves each time when a string property is set.
the lengths and mode (truncation/validation) should be configured in the pvm configuration file.