JPA、EclipseLink 和区分大小写的 mysql 问题

发布于 2024-12-03 23:44:38 字数 509 浏览 3 评论 0原文

我的应用程序在 Windows 环境中运行良好,但是当我尝试在 Linux 服务器中测试时,生成的 JPA EclipseLink sql 出现问题。 我用小写创建了所有表,但是当我查看日志时,我看到类似的东西,全部都是大写:

INSERT INTO PFC(ID, ALUMN,PROPOSED_ID) VALUES (?, ?, ?)

与其他类似的小写(序列)混合:

INSERT INTO buzonmensajes (mensajeid, buzonid) VALUES (?, ?)
        bind => [27, 1]

当然,一切都出了问题,服务器没有找不到大写的表等。

我们使用 orm.xml 来定义所有数据库操作(查询、实体等)以及所有小写的内容...

我知道有一个 Mysql 参数可以更改这些行为,但不幸的是我不是允许更改它。 我的问题是我需要告诉 JPA 创建所有查询并插入表名小写的统计数据

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无名指的心愿 2024-12-10 23:44:38

出现此问题的原因可能是您允许 EclipseLink 默认某些名称。如果您使用数据库的大小写指定名称,EclipseLink 应默认使用这些大小写。

如果您发现这不起作用,您始终可以通过使用 '\"' 模式的分隔标识符来强制区分大小写:@Table("\"pfc\"") 但这不是必需的

。您使用的 EclipseLink 版本?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文