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
There is another way to do it, may be even faster (at least it works on 5th version of MySql):
First, check your sql_mode setting: there is a detailed description how to do it. This setting should have value of "" for windows, and "modes" for Unix.
That didn't help me, so I found another setting, this time in jdbc:
jdbcCompliantTruncation=false.
In my case (I used persistence) it is defined in persistence.xml:
These 2 settings work only together, I tried to use them separately and had no effect.
Notice: remember that by setting sql_mode as described above you switch off important database checks, so please do it carefully.