I have a web app, using EclipseLink and MySQL for storing data.
Some of these data are strings, ie varchars in the DB.
In the code of entities, the strings have attributes
Intercept all set method in you JavaBean/POJO, and then get the filed to be set. Check if the field is annotate with @Column and field type is String. Then truncate the field if it's too long than length.