【发布时间】:2016-09-03 09:27:21
【问题描述】:
我尝试设置我的 JPA 映射。由于某些原因,我必须拥有相同的 java 变量/表列名(包括大写字母),但我无法设置休眠。我尝试使用明确的列名:
@Type(type="java.lang.Integer")
@Column(name = "nextInvoiceNr")
public int nextInvoiceNr;
并带有隐式映射:
@Type(type="java.lang.Integer")
public int nextInvoiceNr;
这两种方法都创建不带大写字母的列名 - “nextinvoicenr”。
我还尝试更改休眠配置添加:
lConf.setProperty("hibernate.implicit_naming_strategy", "org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl");
lConf.setProperty("hibernate.physical_naming_strategy", "org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl");
但没有成功
【问题讨论】:
-
这似乎有点奇怪,因为我做的最后一件事是编写一些代码将大写名称转换为小写。你身边有没有实现
ImplicitNamingStrategy或PhysicalNamingStrategy的东西。