title: Spring Data JPA Naming Strategy - Using Camel Case
body: <p>I know there are a lot of questions/answers available on this topic. Unfortunately, none of them has helped me.</p>
  
  <p>I have defined an <code>Entity</code>.</p>
  
  <pre><code>@Entity
  public class SimpleEntity ...
  </code></pre>
  
  <p>Now I want that the mapping to the relational database should work with same name as the one of the entity. Just plain camel case <code>SimpleEntity</code>. To my surprise it doesn't work. As default <code>Spring Data JPA</code> maps it to snake case.</p>
  
  <p>I have read a lot of answers. A solution which was multiple times propagated was to set the physical naming strategy.</p>
  
  <pre><code>spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
  </code></pre>
  
  <p>Setting this option changes the mapping naming to the lower case variant <code>simpleentity</code>. This might be fine when a database is used which is case insensitive but <code>PostgreSQL</code> isn't. </p>
  
  <p><strike>I also read in the hibernate docs that setting the implicit naming strategy should be used to define the implicit mapping (since I haven't defined any table name). But regardless which setting I'm using as implicit naming strategy the mapping remains the same.</strike> Got it, implicit naming strategy is just the logical name mapping.</p>
  
  <p>I am using</p>
  
  <pre><code>spring-boot-starter-data-jpa:1.5.8.RELEASE
  PostgreSQL Version 10.0
  </code></pre>
  
  <p>I have defined the hibernate dialect with the proper value for my database <code>PostgreSQLDialect</code> respective <code>PostgreSQL95Dialect</code>.</p>
  
  <p>I know I can implement a custom <code>PhysicalNamingStrategy</code>. But I just want to have the same table names like my entity names. This should be the standard case, easy as pie, using plain <code>JPA</code> + <code>Hibernate</code> works fine out of the box without any configuration. So why is making Spring such a big deal? </p>