Implement (proprietary) create-drop setting for javax.persistence.schema-generation.database.action

Description

I'm having some difficulties with the new JPA 2.1 schema generation options. I think they are all pretty much useless in a real test harness. See https://java.net/jira/browse/JPA_SPEC-53

Hibernate should implement a (for now) proprietary setting "create-drop". This is the only useful option in the real world.

Note that this is not equivalent to the old "create-drop" in hbm2ddl.auto. I want CREATE statements when the EMF is build and DROP statements when it is closed. I don't want DROP/CREATE when the EMF is build like hbm2ddl.auto does, nothing has to be dropped before anything was created. All this does is generate warnings. This is a chance to fix this legacy behavior with the new JPA schema generation options.

I Have to fall back now to manually calling the old SchemaExport in my test harness, as Persistence.generateSchema() is also totally useless - unless you don't have any auto-generated constraint names.

Activity

Christian BauerMay 16, 2013 at 4:07 PM

The fix for helps. If constraint names are consistent between EMF builds, Persistence.generateSchema() is actually usable.

Details

Assignee

Reporter

Priority

Created May 11, 2013 at 5:03 PM
Updated May 16, 2013 at 4:07 PM