MySQL's version of latin1 is an extended version of CP1252: it uses the 5 bytes that CP1252 leaves undefined. Unfortunately the current Connector/J has a "bug" in that it uses the original CP1252 rather than MySQL's own version. Therefore it's impossible to recover strings whose encoding uses one of these 5 bytes. Patching the Connector/J source to fix the bug could solve the problem, but ideally you should migrate the tables to UTF-8.
A workaround is using the the JDBC getBytes
method instead of getString
to get data from the result set, this way going around the broken encoding handling in the client library:
String recovered = new String(resultSet.getBytes(1), "UTF-8");
I'm not sure if this can help you because with JPA and Hibernate you are quite removed from the JDBC API.