-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Trouble generating .sql file running hbm2ddl from ant task
PostPosted: Mon May 11, 2009 3:40 am 
Beginner
Beginner

Joined: Sat Feb 07, 2009 4:08 pm
Posts: 22
Location: New York City
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.