Jac*_*les 1 java db2 hibernate jpa spring-data-jpa
好的,我正在尝试通过 JPA(休眠)将 SpringBoot 应用程序连接到旧的 AS/400 DB 数据库。然而,表名有一个“。” (期间)在他们。例如:LE.ONFP 是表名。然而,Hibernate 正在将句点转换为下划线,这会导致错误,因为没有名为“le_onfp”的表。
@Entity
@Table(name = "\"LE.OFNP\"", schema = "QS36F")
Run Code Online (Sandbox Code Playgroud)
这是我在实体类开头的注释。
将以下行添加到我的 application.properties 文件中修复了我的问题。
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
并保持我的注释不变。
@Table(name = "\"LE.OFNP\"", schema = "QS36F")
| 归档时间: |
|
| 查看次数: |
1500 次 |
| 最近记录: |