1

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.

4
  • I have also tried used `@Table(name="'LE.OFNP'", schema = "QS36F") (single quote round the table name) Commented Sep 13, 2017 at 13:27
  • and I'v tried with backticks around the table name Commented Sep 13, 2017 at 13:27
  • read this stackoverflow.com/questions/37057025/… Commented Sep 13, 2017 at 13:32
  • backticks before the "." is the only one that would make any sense Commented Sep 13, 2017 at 14:55

1 Answer 1

5

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")

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.