org.postgresql.util.PSQLException: ERROR: column user0_.id does not exist - Hibernate

后端 未结 6 2153
野性不改
野性不改 2021-02-05 02:47

I have a model class that is mapped to a postgres database using hibernate. My model class is:

@Entity
@Table(name=\"USER\")
public class User {

    @Id 
    @G         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 03:34

    Should add schema name on the Entity class. For this example, when the schema name is public

    @Table(name = "user", schema = "public")
    

    See the PostgreSQL Admin view below

    See here for more about SpringBoot Java and Postgre SQL connectivity: https://cmsoftwaretech.wordpress.com/2020/04/25/springboot-thymleaf-using-postgresql/

提交回复
热议问题