Spring data JPA solves the problem of using the PostgreSQL table name case

Source: Internet
Author: User
Tags postgresql

The domestic article looked again, actually did not find the fundamental problem solution, the following will enumerate this series of problem solving method:

1. Add the following configuration in the configuration file:

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

2. Add the following annotations on the entities and attributes, respectively:

 
// Table Name
@Table("\"User\"")
// field
@Column("\"Name\"")

Solve from the fundamental problem:

1, in fact, in the design of the database, including on the MySQL is not allowed to appear in uppercase table names, and the adjacent letters using an underscore mark.

2. From now on, you should turn your database design into lowercase and remove the code above.


Reference:

Https://stackoverflow.com/questions/36353492/jpa-uppercase-table-names

Https://stackoverflow.com/questions/28571848/spring-boot-jpa-insert-in-table-with-uppercase-name-with-hibernate


Spring data JPA solves the problem of using the PostgreSQL table name case

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.