如何将Hibernate NamingStrategy迁移到(隐式|物理)NamingStrategy?文档在哪里? [英] How to migrate a Hibernate NamingStrategy to (Implicit|Physical)NamingStrategy? Where is the documentation?

查看:380
本文介绍了如何将Hibernate NamingStrategy迁移到(隐式|物理)NamingStrategy?文档在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NamingStrategy 在Hibernate 4.2 / 4.3中已被标记为不推荐使用( HHH-7079 )。从Hibernate 5开始,现在它将附带两个替换(?)接口 ImplictNamingStrategy PhysicalNamingStrategy HHH-7078 ),并最终放弃了对旧的 NamingStrategy 。这就是为什么Spring即将推出的Hibernate5甚至已经删除了配置器 namingStrategy()并支持 implicitNamingStrategy() physicalNamingStrategy()。到目前为止,这么好。



尽管它在一些文档中提到过(即在不完整的 working-5.0-migration-guide.md )和即将发布的Hibernate 5的(生成的)发行说明截至今天),我没有找到具体的例子 如何真正使用这些。



也许我错过了一些东西,但没有JavaDoc也没有问题显示这两种策略类型的想法的任何证据。此外,我已经有一个基于 NamingStrategy 的策略:一个基于 OracleNamingStrategy https://code.google.com/p/hibernate-naming-strategy-for-oracle/rel =nofollow noreferrer>众所周知的



尽管我对代码中的正确解决方案很感兴趣,但实际问题在于获得有效的迁移文档和/或重新命名策略的概念性概念。




还有相关:


解决方案

在您的hibernate配置文件中放置键值对
$ b


hibernate.implicit_naming_strategy = org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl

hibernate.physical_naming_strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl


The NamingStrategy was already being marked as deprecated in Hibernate 4.2/4.3 (HHH-7079). Starting with Hibernate 5, now it will shipped with two replacements(?) interfaces ImplictNamingStrategy and PhysicalNamingStrategy (HHH-7078) and have finally ditched support for the old NamingStrategy. That's why Spring's upcoming Hibernate5 supported has even removed the configurer namingStrategy() and favor of implicitNamingStrategy() and physicalNamingStrategy(). So far, so good.

Although it is mentioned in some documents (i.e. in the incomplete working-5.0-migration-guide.md) and in (generated) release notes for the upcoming Hibernate 5 (as of today), I've found no concrete example how to use these actually.

Perhaps I've missed something, but neither the JavaDoc nor the issues shows any evidence of the idea both strategy types. Furthermore I've already one strategy based on NamingStrategy: a custom OracleNamingStrategy which is based on the well-known one.

While I'm interested in a proper solution in code (obviously), the actual issue is getting a working migration document and/or the conceptual idea of the restructured naming strategy.


Also related:

解决方案

Put below key value pair in your hibernate configuration file

hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl

hibernate.physical_naming_strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

这篇关于如何将Hibernate NamingStrategy迁移到(隐式|物理)NamingStrategy?文档在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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