Thread:
 creating database tables 
 jnicho02   19 Apr 2004, 18:20 
 Re: creating database tables 
 brondsem   26 May 2004, 20:10 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: brondsem (26 May 2004, 20:10) Replies: 0, Views: 38617
Subject: Re: creating database tables
On 19 Apr 2004 18:20, jnicho02 wrote:

>It is useful to reference the SchemaExportTask in order to make a
>create-tables.sql script. Something like....

>  <target name="createtables" description="creates database tables">
>    <taskdef
>       name="schemaexport"
>       classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
>
>classpath="${classpath};${class.dir};${lib.dir}/hibernate2.jar;${lib.di
>r}/dom4j-1.4.jar;${lib.dir}/commons-logging.jar;${lib.dir}/commons-
>collections-2.1.jar;${lib.dir}/jtds-0.7.1.jar;${lib.dir}/odmg-3.0.jar">
>    </taskdef>
>    <schemaexport quiet="no" text="no" drop="no" delimiter=";"
>      properties="${class.dir}/hibernate.properties"
>      output="create-tables.sql">
>      <fileset dir="${class.dir}" includes="**/*.hbm.xml"/>
>    </schemaexport>
>  </target>

I didn't realize it, but you must have *your* classes are in the
classpath.  For example in maven, you can do:
   <classpath>
       <path refid="maven.dependency.classpath"/><!-- our dependencies  -->
       <pathelement location="${maven.build.dest}"/><!-- our classes -->
   </classpath>
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]