简体   繁体   中英

SpringBoot JPA Hibernate DB Table name with a "." (period) in it

OK, I'm trying to connect my SpringBoot application via JPA (Hibernate) to a legacy AS/400 DB database. The table names however have a "." (Period) in them. ex: LE.ONFP is the table name. Hibernate however is converting the period to an underscore which causes an error because there is not table called "le_onfp".

@Entity
@Table(name = "\"LE.OFNP\"", schema = "QS36F")

Here is my annotations at the beginning of my Entity class.

adding the following line to my application.properties files fixed my issue.

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

and keeping my annotation the same. @Table(name = "\\"LE.OFNP\\"", schema = "QS36F")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM