-->
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.  [ 4 posts ] 
Author Message
 Post subject: How can i create seperate DDL files with hbm2ddl tools?
PostPosted: Sun Oct 26, 2003 4:33 am 
Newbie

Joined: Sun Oct 26, 2003 4:20 am
Posts: 1
I can user hbm2ddl tools to create ddl file like this:
Code:
<target name="schemaexport">
       <taskdef name="schemaexport"
           classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
           classpathref="classpath"/>
      
       <schemaexport
           properties="${classes.dir}\hibernate.properties"
           quiet="no"
           text="no"
           drop="no"
           delimiter=";"
           output="{table.dir}/out.sql">
           <fileset dir="src">
               <include name="**/*.hbm.xml"/>
           </fileset>
       </schemaexport>
   </target>


and it create a ddl file which contains ddls to create all tables.

If I want to use each hbm.xml to create a seperate sql file, how can i achieve it?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 7:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I don't think it is an option. You could post process I suppose.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 2:54 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
it doesn't make any sense that you would be able to do that since schemas have dependencies on each other and must be created/dropped in a certain order.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2003 6:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I have been at sites that require the ddl for table creation to be in separate files. These are checked out of CVS and updated when tables changes are made. The creation order is only required for the embedded foreign key constraints. These can be all located in a separate file as well which just gets processsed last. True its lots of alter table statements but works OK and removes the need to be concerned with table creation order.


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

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.