title: problems configuring Hibernate with spring boot, CommandLineRunner
body: <p>I'm using Spring Tool Suite to create a Spring Boot application that uses Hibernate.</p>
  
  <p>Here's my application.properties file:</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql:someurl
  spring.datasource.username=somename
  spring.datasource.password=somepassword
  spring.datasource.driverClassName=com.mysql.jdbc.Driver
  spring.jpa.hibernate.ddl-auto=create
  spring.jpa.database-platform=org.hibernate.dialect.SQLServerDialect
  spring.jpa.show-sql=true
  </code></pre>
  
  <p>I'm trying to run the following CommandLineRunner:</p>
  
  <pre><code>@Bean
  public CommandLineRunner demo(CustomerRepository repository) {
      return (args) -&gt; {
  
          Configuration configuration = new Configuration().configure();
  
          ServiceRegistryBuilder registry = new ServiceRegistryBuilder();
          registry.applySettings(configuration.getProperties());
          ServiceRegistry serviceRegistry = registry.buildServiceRegistry();
          SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
  
          Session session = sessionFactory.openSession();
  
          Transaction t = session.beginTransaction();
  
          Customer e1 = new Customer();
          //blah blah blah
          session.persist(e1);
  
          t.commit();
  
          session.close();
  
  
      };
  }
  </code></pre>
  
  <p>My problem is:</p>
  
  <pre><code>Configuration configuration = new Configuration().configure();
  </code></pre>
  
  <p>looks for "hibernate.cfg.xml" and all my hibernate config is in application.properties</p>
  
  <p>How do I cause the Hibernate config stuff to initialize itself with the stuff in application.properties?</p>