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
You can set your database to work in a non strict mode as explained here: Automatically trimming length of string submitted to MySQL
Note that it might cancel other validations too so be careful in what you wish for