| Having following in my persistence.xml:
<property name="javax.persistence.schema-generation.database.action" value="create" />
<property name="javax.persistence.schema-generation.create-source" value="script-then-metadata" />
<property name="javax.persistence.schema-generation.create-script-source" value="META-INF/execute-before-metadata-ddl.sql" />
then Hibernate at first executes the execute-before-metadata-ddl.sql file and then generates the remainig ddl via the metadata. That's fine. However If I use the update action instead of the create action the execute-before-metadata-ddl.sql does not get executed anymore:
<property name="javax.persistence.schema-generation.database.action" value="update" />
I also tried
<property name="javax.persistence.schema-generation.update-script-source" value="META-INF/execute-before-metadata-ddl.sql" />
without any success. I think there should be a way of executing a sql file when using the update action - either by just re-using the javax.persistence.schema-generation.create-script-source property or by introducing the property javax.persistence.schema-generation.update-script-source. Thanks! |