No target script generated for update action when using schema-generation

Description

Having following in my persistence.xml:

<property name="javax.persistence.schema-generation.database.action" value="update" /> <property name="javax.persistence.schema-generation.scripts.action" value="update" />

then Hibernate creates/alters tables, columns, etc. like it should. That's fine.

However I can not log the used database statements anywhere!

E.g. when using create / drop-and-create / drop as actions and configure:

<property name="javax.persistence.schema-generation.scripts.create-target" value="create.ddl"/> <property name="javax.persistence.schema-generation.scripts.drop-target" value="drop.ddl"/>

the create.ddl and drop.dll file gets created and contains the statements.

However it seems there is no way to create such a script file when using update.
I would expect that there should be a setting like:

<property name="javax.persistence.schema-generation.scripts.update-target" value="update.ddl"/>

but this doesn't work.

Please give us a way to generate a script file when using the update action, thanks!

Activity

Show:

Andrea Boriero April 15, 2016 at 10:20 AM

Matthias Kurz April 14, 2016 at 10:04 AM

Thanks!

Andrea Boriero April 14, 2016 at 10:02 AM

Thanks ,

I'm going to give a look..

Matthias Kurz April 14, 2016 at 9:55 AM
Edited

Hi @Andrea Boriero

yes I did try this but it doesn't work. It creates the update.ddl file, but it is empty (but the database gets updated as expected).

Andrea Boriero April 14, 2016 at 9:49 AM

Hi
have you tried

<property name="javax.persistence.schema-generation.scripts.create-target" value="update.ddl"/>

in conjunction with

<property name="javax.persistence.schema-generation.database.action" value="update" /> <property name="javax.persistence.schema-generation.scripts.action" value="update" />

?

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created April 14, 2016 at 8:58 AM
Updated June 2, 2016 at 3:51 AM
Resolved May 12, 2016 at 10:08 AM