| Hi, I am using the JPA2.1 API: Persistence.generateSchema(persistentUnit, properties) with Hibernate 4.3,5.0,5.1. My code: https://github.com/lorislab/jpa2-maven-plugin/blob/master/src/main/java/org/lorislab/maven/jpa2/SchemaGeneratorMojo.java Hibernate 4.3.x, 5.0.x generated the DDL-script fine (without semicolon). Hibernate 5.1 and Persistence.generateSchema generated the DDL-script with semicolon but the output file contains two same DDL-scripts. Example: Create Table TABLE1 Create Index INDEX1 Create Table TABLE1 Create Index INDEX1 I think it’s because of the code in the EntityManagerFactoryBuilderImpl and SessionFactoryImpl. Class: org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.generateSchema try { SessionFactoryBuilder sfBuilder = metadata().getSessionFactoryBuilder(); populate( sfBuilder, standardServiceRegistry ); sfBuilder.build(); SchemaManagementToolCoordinator.process( metadata, standardServiceRegistry, configurationValues, DelayedDropRegistryNotAvailableImpl.INSTANCE ); } The line sfBuilder.build(); call the org.hibernate.internal.SessionFactoryImpl constructor. Line 458 of the SessionFactoryImpl constructor: SchemaManagementToolCoordinator.process( metadata, serviceRegistry, properties, new DelayedDropRegistry() { @Override public void registerOnCloseAction(DelayedDropAction action) { SessionFactoryImpl.this.delayedDropAction = action; } } ); Commit: https://github.com/hibernate/hibernate-orm/commit/17de173cb5334d866f1886d3e057f49a6c987bad |