Problem with JPA, EclipseLink and case sensitive mysql

谁都会走 提交于 2019-12-10 14:28:48

问题


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


回答1:


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?



来源:https://stackoverflow.com/questions/7392666/problem-with-jpa-eclipselink-and-case-sensitive-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!