title: Spring Boot - Hibernate - Table does not exists
body: <p>I have a 3rd party jar that holds all the entities and mapping.  I am currently using this jar successfully in a classic Spring-MVC application,  but now I am trying to use it in a Spring-Boot application. (1.5.7.RELEASE)</p>
  
  <p>I have this for my Applicaion.java:</p>
  
  <pre><code>@SpringBootApplication
  @EntityScan(basePackages = "com.third.party.entity.package")
  public class Application extends SpringBootServletInitializer {
  
      public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p>As it is a third party, I have to have the session scan as well so I have this in my @Configuration class:</p>
  
  <pre><code>@Bean
  public LocalSessionFactoryBean sessionFactory(EntityManagerFactory emf) throws ClassNotFoundException {
      LocalSessionFactoryBean fact = new LocalSessionFactoryBean();
      fact.setAnnotatedPackages("com.third.party.entity.package");
      fact.setPackagesToScan("com.third.party.entity.package");
      fact.setDataSource(dataSource);
      return fact;
  }
  </code></pre>
  
  <p>and this in my application.properties:</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql://dbserver:3306/mydb?useSSL=false
  spring.datasource.username=user
  spring.datasource.password=password
  spring.datasource.tomcat.max-wait=20000
  spring.datasource.tomcat.max-active=50
  spring.datasource.tomcat.max-idle=20
  spring.datasource.tomcat.min-idle=15
  spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.MySQL5Dialect
  spring.jpa.properties.hibernate.id.new_generator_mappings = false
  spring.jpa.properties.hibernate.format_sql = true
  spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code>Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mydb.user' doesn't exist
  </code></pre>
  
  <p>Now the table name is "User" so that sort of makes sense. However,  I am using this jar for another application so all of the other 100 answers on this subject do not apply. </p>
  
  <p>It MUST be a configuration issue? Right? </p>
  
  <p><strong>UPDATE</strong>
  I tried @sam answer below to no avail,  but I was able to look at the source code of this 3rd party jar file,  and it looks like this:</p>
  
  <pre><code>@Entity
  @Table(name = "User")
  public class User {
       etc...
  }
  </code></pre>
  
  <p>So the table name in the annotation is correct.  How do I get Spring to use that?  Im looking a default naming strategies and stuff...  Any Suggestions?</p>