title: Prevent hibernate from generating all query plan on startup when using spring data jpa and rest
body: <p>I'm using spring data jpa, rest, hibernate entitymanager 4.3.6 with spring boot, and initializing is too slow. More than 1m+.</p>
  
  <p>Hibernate walks through all attributes, and generate query on startup.</p>
  
  <p>How can I prevent this?</p>
  
  <p>Log:
  <a href="https://gist.github.com/ceram1/b9d90acaaac5e89d75a8#file-log-txt" rel="nofollow">Log file on github gist</a></p>
  
  <p>Bean definition:</p>
  
  <pre><code>@Bean
  public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
  
  
      LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
      em.setDataSource(dataSource);
      em.setPackagesToScan("com.ceram1.openauth.persistence.model");
  
      JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
      em.setJpaVendorAdapter(vendorAdapter);
      em.setJpaProperties(additionalProperties());
      em.setSharedCacheMode(SharedCacheMode.ALL);
      return em;
  }
  </code></pre>
  
  <p>properties config: </p>
  
  <pre><code>    p.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
      p.setProperty("hibernate.query.startup_check", "false");
      p.setProperty("hibernate.show_sql", "true");
      p.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5InnoDBDialect");
      p.setProperty("jadira.usertype.autoRegisterUserTypes", "true");
      p.setProperty("hibernate.connection.CharSet", "utf8");
      p.setProperty("hibernate.connection.characterEncoding", "utf8");
      p.setProperty("hibernate.connection.useUnicode", "true");
      p.setProperty("hibernate.cache.use_second_level_cache", "false");
      p.setProperty("hibernate.cache.use_query_cache", "false");
  </code></pre>