title: Where did Configuration.generateSchemaCreationScript() go in Hibernate 5
body: <p>In Hibernate 4.x, I used to generate and export the schema as defined in annotated entities as follows (using Spring to find annotated entities on the class path):</p>
  
  <pre><code>Connection connection = 
      DriverManager.getConnection("jdbc:h2:mem:jooq-meta-extensions", "sa", "");
  
  Configuration configuration = new Configuration()
      .setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
  
  // [...] adding annotated classes to Configuration here...
  
  configuration.generateSchemaCreationScript(
      Dialect.getDialect(configuration.getProperties()));
  SchemaExport export = new SchemaExport(configuration, connection);
  export.create(true, true);
  </code></pre>
  
  <p>This no longer works in Hibernate 5.0:</p>
  
  <ul>
  <li><a href="https://docs.jboss.org/hibernate/orm/4.3/javadocs/org/hibernate/cfg/Configuration.html#generateSchemaCreationScript(org.hibernate.dialect.Dialect)"><code>Configuration.generateSchemaCreationScript()</code></a> no longer exists</li>
  <li>The <a href="https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/tool/hbm2ddl/SchemaExport.html#SchemaExport-org.hibernate.cfg.Configuration-java.sql.Connection-"><code>SchemaExport(configuration, connection)</code></a> constructor is now deprecated</li>
  </ul>
  
  <p>I didn't really find any obvious references to this change in the <a href="https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc">migration guide</a> apart from:</p>
  
  <blockquote>
    <p>Quite a few methods have been removed from Configuration</p>
  </blockquote>
  
  <p>What is the correct way to generate and export a database <em>on an existing JDBC connection</em> with Hibernate 5.0 based on a set of annotated entities? (Pure JPA-based solutions are fine, too)</p>
  
  <p>(note, just removing the call to <code>generateSchemaCreationScript()</code> seems to work, but I would prefer to be sure to get this right)</p>