I have a table in Postgresql:
CREATE TABLE "UTILISATEUR"(
"IdUtilisateur" serial NOT NULL,
"Nom" character varying(50),
&qu
I reproduced your UTILISATEUR table (role removed) in postgres 8.4 and hibernate 5.0.3.
It works as expected with explicit table and column names annotation:
@Entity(name="\"UTILISATEUR\"")
public class Utilisateur {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="\"IdUtilisateur\"")
private Long id ;
@Column(name="\"Nom\"")
private String Nom ;
@Column(name="\"Prenom\"")
private String Prenom ;
@Column(name="\"Profil\"")
private String Profil ;
@Column(name="\"Pseudo\"")
private String Pseudo ;
@Column(name="\"Password\"")
private String Password ;
... getter / setters
}
maybe because you are using MYSQL5DIALECT there's a Postgres Dialect just used post it like this and for the improved naming strategy use EJB3 like Spring boot JPA insert in TABLE with uppercase name with Hibernate
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
hope it works for you
You can configure your application with the next line depend the database:
MySql
spring.jpa.hibernate.naming_strategy = org.hibernate.cfg.DefaultNamingStrategy
Postgres
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
Oracle
spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect
I faced the same issue and I back quoted ( ` ) my table name in the entity declaration like this
"`UTILISATEUR`".
@Table(name = "
`UTILISATEUR`")
` using postgresql 11 with dialect : org.hibernate.dialect.PostgreSQL95Dialect it generated me an upercased table name on database.