My application is working fine in a Windows environment, but when I'm trying to test in a linux server, I have a problem with the JPA EclipseLink sql generated. I created all my tables in lower case, but when I look in the logs, I see something like that, all in upper case:
INSERT INTO PFC(ID, ALUMN,PROPOSED_ID) VALUES (?, ?, ?)
mixed with others like this (sequences) in lower case:
INSERT INTO buzonmensajes (mensajeid, buzonid) VALUES (?, ?)
bind => [27, 1]
and of course, everything goes wrong, server didn't find the uppercase tables, etc..
We use orm.xml to define all the database actions (queries,entities, etc..) and everything it's in lowercase...
I know that there are a Mysql paramater to change these behaviour, but unfortunately I'm not allowed to change it. My problem is that I need to tell to JPA to create all the querys and insert statmets with the table name in lower case
Another way for case-insensitive matching is to use a different “collation”. The default collations used by SQL Server and MySQL do not distinguish between upper and lower case letters—they are case-insensitive by default.
Table names are stored in lowercase on disk and name comparisons are not case-sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases.
MySQL's like should be case-insensitive by default.
The issue is likely occurring because you are allowing EclipseLink to default some of the names. If you specify the names using the case of your database EclipseLink should use those cases by default.
If you find that is not working you can always enforce case by using delimited identifiers using the '\"' pattern : @Table("\"pfc\"")
but this should not be required.
What version of EclipseLink are you using?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With