We're updating the issue view to help you get more done. 

Better encapsulate SchemaManagementTool (OGM) - unify JPA schema generation and hbm2ddl capabilities


At the end of the day, the point of this enhancement request is to better encapsulate SchemaManagementTool such that OGM etal can really truly replace that service. This is a multi-faceted request.

The main consideration is the org.hibernate.tool.schema.spi.Target contract as it is passed to the individual delegates of the SchemaManagementTool. Target assumes that schema management commands are representable as Strings as they are in RDBMS/JDBC environment. For OGM however that is often not the case. To cater for that, Target should no longer be passed into the SchemaManagementTool delegates. Instead, the SchemaManagementTool implementation or its delegates should interpret any config and decide itself what to do. In that sense, Target would become an internal detail within the standard ORM SchemaManagementTool implementation.

Another facet involves unifying the JPA schema generation and hbm2ddl capabilities. At the moment OGM would not be able to override how JPA schema generation works. We obviously need to account for that. The corollary to Target on the JPA schema-gen side is org.hibernate.jpa.internal.schemagen.GenerationTarget. They are pretty equivalent except that Target accepts commands one by one, whereas GenerationTarget accepts them all at once. Seeing how org.hibernate.jpa.internal.schemagen.JpaSchemaGenerator is not replaceable by the user or integrations at all anyway, dramatically changing these contracts and/or moving them around is not a major concern.





Steve Ebersole


Gunnar Morling

Fix versions