What I would like to do is run the ANT task hibernatetool to run hbm2ddl to generate a 'DELTA' file, giving me the neccessary updates to the current schema in a .sql file while not performing any database update literally.
I have been using this code (see below) successfully to generate a complete schema (schemaexport), but when I add the update="true" parameter (schemaupdate) it does not generate any file even though there were updates made to an Entity bean ( I simply added a column).
I can see from the console that when the ant task runs schemaupdate there IS an alter table statement generated, but no sql file is produced. If I set export=true it WILL update the database...but still will not generate a file
If I remove the update=true parameter, then a complete schema is generated and a file is produced.
Am I missing something? Is it possible to generate an update-ddl.sql file that contains only the 'delta' of updates to the current schema using an ANT TASK?
This is the code I am using - works perfect sans update=true, but with update=true it does not generate a file.
Code:
<target name="schemaexport" depends="local"
description="Exports a generated schema to DB and file">
<hibernatetool destdir="${basedir}">
<classpath path="${web.home}/WEB-INF/classes"/>
<jpaconfiguration persistenceunit="myApp"/>
<hbm2ddl
drop="true"
create="true"
update="true"
export="false"
outputfilename="${app.name}update-ddl.sql"
delimiter=";"
format="true"/>
</hibernatetool>
</target>