Use case: I have a configured EMF and I want to have the DDL creation scripts (e.g.: create table ...) for this EMF as String.
In Hibernate 4 it was possible by the Configuration. The Hibernate 5 documentation still describes that way:
Code:
Configuration cfg = ....;
new SchemaExport(cfg).create(false, true);
But Hibernate 5 now provides the SchemaManagementTool and the SchemaCreator. However I have found no way to get the MetadataImplementor, especially from an existing EMF.
Very cool would be a feature like new SchemaCreator(EntityManagerFactory emf).
Any suggestion how I can create the script by an existing EMF?