2

我正在从 Hibernate 迁移到 EclipseLink。

我意识到的是,Hibernates ddl-generation 为驼峰式列创建下划线分隔的 sql 列

<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy" />

在我的persistence.xml 中。我非常喜欢那个。

我的问题是:我怎样才能让 EclipseLink 做到这一点?

强尼

4

2 回答 2

2

我找到了解决方案。您必须使用 EclipseLink Session-Customizer 类。
在这里解释(如果您向下滚动该页面,则以示例为例):http ://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg00094.html

强尼

于 2012-09-20T09:26:59.440 回答
0

分叉这个https://gist.github.com/iromu/6864061。数字不被识别为用下划线包围的字符,您可以使用 @Column(name="") 覆盖映射

于 2013-10-07T08:25:42.163 回答