休眠方案命名在OS之间不同 [英] Hibernate scheme naming differs between OS

查看:75
本文介绍了休眠方案命名在OS之间不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临的问题是,hibernate生成的模式名称(例如表名)在Windows和Linux之间有所不同。在Windows上,所有的表名都是小写的,例如 account ,而在Linux下,创建的表名称是骆驼案例,例如, Account



在这两个系统上,我在相同版本和以下hibernate配置中使用MySQL 5:

 < prop key =hibernate.dialect> org.hibernate.dialect.MySQL5InnoDBDialect< / prop> 
< prop key =hibernate.jdbc.batch_size> 0< / prop>
< prop key =hibernate.bytecode.provider> cglib< / prop>
< prop key =hibernate.hbm2ddl.auto> update< / prop>

这里会发生什么?基本上我可以忍受那个奇怪的问题,但有时它的烦人我不能只从我的Windows IDE中将我的表导出到我的Linux环境中。 解决方案

您可能希望将属性 hibernate.ejb.naming_strategy 设置为 org.hibernate.cfg.ImprovedNamingStrategy 或实施您自己的命名策略类。


I am facing the problem that the hibernate generated schema names (table names for example) differ between Windows and Linux. On Windows all table names are small case, e.g. account, whereas under Linux created table names are camel cases, e.g. Account.

On both systems I use MySQL 5 in the same version and the following hibernate config:

<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop key="hibernate.bytecode.provider">cglib</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop> 

What happens here? Basically I can live with that weird issue, but sometimes its annoying I cannot just export my tables from my windows IDE to my linux environment.

解决方案

You might want to set the property hibernate.ejb.naming_strategy to org.hibernate.cfg.ImprovedNamingStrategy or implement your own naming strategy class.

这篇关于休眠方案命名在OS之间不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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