JPA 2.0& MySQL不尊重区分大小写的表名 [英] JPA 2.0 & MySQL are not respecting case sensitive table names

查看:553
本文介绍了JPA 2.0& MySQL不尊重区分大小写的表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个奇怪的问题,我的耳朵项目:
我已经把正确的注释放在我的实体类中:



<$ p $

















$ <但是,当我在glassfish 3.1.2.2上部署我的应用程序时,我发现JPA创建了具有小写字母的表格



我正在使用EclipseLink 2.4.1

>

请帮助我。

解决方案

我从Brian Vosburgh的评论中得到了解决方案:
在Windows的MySQL版本中,表格的名字被设置为小写。在linux上,默认情况下,这个配置是被禁用的,并且JPA设置的表名被应用到MySQL而不需要修改。



使它像linux一样在windows上运行,添加一行:

  lower_case_table_names = 0 

感谢您的帮助,特别是 Brian Vosburgh



I have a strange issue my ear project: I have put the correct annotations on my entity class:

@Entity
@Table(name = "PRODUCTS")

But when I deploy my application on glassfish 3.1.2.2, I find that JPA has created the tables with lowercase chars

I am using EclipseLink 2.4.1

Please Help me.

解决方案

I got the solution from Brian Vosburgh's comment: In the windows version of MySQL the names of table are set to lower case. On linux, by default, this configuration is disabled, and the tables'names set by JPA are applied to MySQL without modification.

To make it working on windows as like linux, add the line:

lower_case_table_names=0

Thank you for your help, specially Brian Vosburgh

这篇关于JPA 2.0&amp; MySQL不尊重区分大小写的表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆