JPA Uppercase table names
<p>I have a table in Postgresql:</p>
<pre><code>CREATE TABLE &quot;UTILISATEUR&quot;(
 
 &quot;IdUtilisateur&quot; serial NOT NULL,
 &quot;Nom&quot; character varying(50),
 &quot;Prenom&quot; character varying(50),
 &quot;Profil&quot; character varying(50),
 &quot;Pseudo&quot; character varying(20),
 &quot;IdSite&quot; integer DEFAULT 0,
 &quot;Password&quot; character varying(1024),
  id_role integer,
  )
</code></pre>
<p>and I am trying Map on this Table So I used <code>@Table</code> JPA annotation (see below). This is my <code>application.propreties</code>:</p>
<pre><code>spring.datasource.url = jdbc:postgresql://localhost/baseecu
spring.datasource.username = postgres
spring.datasource.password =root
spring.datasource.driverClassName=org.postgresql.Driver
spring.jpa.database = MYSQL 
spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto=update 
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
</code></pre>
<p>and finaly this is my entity class:</p>
<pre><code>@Entity
@Table(name=&quot;UTILISATEUR&quot;)
public class Utilisateur   {
@Id
@GeneratedValue(strategy=GenerationType.AUTO) 
@Column(name=&quot;IdUtilisateur&quot;)
public Long id ;
public String Nom ; 
public String Prenom ; 
public String Profil ; 
public String Pseudo ; 


public String Password ;
@ManyToOne
@JoinColumn(name=&quot;id_role&quot;)
public Role role ;
public Long getId() {
    return id;
</code></pre>
<p>If I have it like this <code>@Table(name=&quot;UTILISATEUR&quot;)</code> I get msg from PostgreSQL</p>
<pre><code>ERREUR: la relation « utilisateur » n'existe pas 
</code></pre>
<p>When I try to escape quote <code>@Table(name=&quot;\&quot;UTILISATEUR\&quot;&quot;)</code></p>
<pre><code>ERROR: syntax error at or near &quot;`&quot;
</code></pre>
<p>I tried the responses from this question but it doesn't work</p>
<p><a href="https://stackoverflow.com/questions/28571848/spring-boot-jpa-insert-in-table-with-uppercase-name">Spring boot JPA insert in TABLE with uppercase name with Hibernate</a></p>
<h1>update</h1>
<p>I've been searching about ImprovedNamingstrategy it's seems like an issue in spring boot instead I've used EJB3NamingStrategy and also DefaultNamingStrategy it's not working what funny it's when Hibernate execute the SQL the result is pretty confusing :</p>
<pre><code>Hibernate: select utilisateu0_.IdUtilisateur as IdUtilis1_2_, utilisateu0_.Nom as Nom2_2_, utilisateu0_.Password as Password3_2_, utilisateu0_.Prenom as Prenom4_2_, utilisateu0_.Profil as Profil5_2_, utilisateu0_.Pseudo as Pseudo6_2_, utilisateu0_.id_role as id_role7_2_ from UTILISATEUR utilisateu0_ 
</code></pre>
<p>It's like it knows the table name is in UPPERCASE but does not want to map or I don't know what wrong with it this is the result of using</p>
<pre><code>spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.DefaultNamingStrategy
or 
spring.jpa.hibernate.naming_strategy = org.hibernate.cfg.DefaultNamingStrategy
</code></pre>
<p>and also the EJB3NamingStrategy</p>
<p>This is also the result when I use the annotation like that</p>
<pre><code>@Table(name=&quot;UTILISATEUR&quot;)  
</code></pre>
<p>and I also tried like that</p>
<pre><code>@Table(name=&quot;\&quot;UTILISATEUR\&quot;&quot;)
</code></pre>
<p>and I get the issue</p>
<pre><code>ERROR: syntax error at or near &quot;`&quot;

Hibernate: select utilisateu0_.IdUtilisateur as IdUtilis1_2_, utilisateu0_.Nom as Nom2_2_, utilisateu0_.Password as Password3_2_, utilisateu0_.Prenom as Prenom4_2_, utilisateu0_.Profil as Profil5_2_, utilisateu0_.Pseudo as Pseudo6_2_, utilisateu0_.id_role as id_role7_2_ from `UTILISATEUR` utilisateu0_ 
</code></pre>
<p>finally this is my <code>pom.xml</code></p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

&lt;groupId&gt;com.xx.MDValidation&lt;/groupId&gt;
&lt;artifactId&gt;xx.MDValidation&lt;/artifactId&gt;
&lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;jar&lt;/packaging&gt;

&lt;name&gt;xx.MDValidation&lt;/name&gt;
&lt;description&gt;Projet Validation xx&lt;/description&gt;

&lt;parent&gt;
&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
&lt;version&gt;1.3.2.RELEASE&lt;/version&gt;
&lt;/parent&gt;
&lt;properties&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
&lt;hibernate.version&gt;4.2.21.Final&lt;/hibernate.version&gt;
&lt;commons-dbcp.version&gt;1.2.2&lt;/commons-dbcp.version&gt;
&lt;/properties&gt;

    &lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
        
    &lt;/dependency&gt;

    
        &lt;dependency&gt;
&lt;groupId&gt;postgresql&lt;/groupId&gt;
&lt;artifactId&gt;postgresql&lt;/artifactId&gt;
&lt;version&gt;9.1-901.jdbc4&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
        &lt;groupId&gt;mysql&lt;/groupId&gt;
        &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;scope&gt;runtime&lt;/scope&gt;
    &lt;/dependency&gt;

    
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;mysql&lt;/groupId&gt;
        &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;scope&gt;runtime&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-jooq&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;bsf&lt;/groupId&gt;
        &lt;artifactId&gt;bsf&lt;/artifactId&gt;
        &lt;version&gt;2.4.0&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;/dependencies&gt;


&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;
</code></pre>