If you're not requiring updating an existing database filled with data,
then calling the torque tasks is probably the easiest option. In fact, the
OJB unit tests use the same strategy. For instance, In the build.xml of
OJB you'll find the following part:
<!-- prepare testdb using torque -->
<target name="prepare-testdb"
description="prepare testdb using torque"
depends="prepare, prepare-repository">
<antcall target="getJSQLDriver"/>
<!-- create sql scripts -->
<ant dir="."
antfile="${torque.buildFile}"
target="project-sql-classpath"/>
<!-- create db -->
<ant dir="."
antfile="${torque.buildFile}"
target="project-create-db-classpath"/>
<!-- create data sql -->
<ant dir="."
antfile="${torque.buildFile}"
target="project-datasql-classpath"/>
<!-- create tables -->
<ant dir="."
antfile="${torque.buildFile}"
target="project-insert-sql"/>
</target>
<!-- dump testdb using torque -->
<target name="dump-testdb"
description="dump testdb using torque">
<ant dir="."
antfile="${torque.buildFile}"
target="project-datadtd-classpath"/>
<ant dir="."
antfile="${torque.buildFile}"
target="project-datadump-classpath"/>
</target>
The major obstacles to using these targets are their implicit requirements
on certain properties such as "lib.dir" etc. As I said, a basic example
on how to use them is in the xdoclet ojb module (in the
xdoclet-ojb-module-doc.zip archive in the contrib sub directory of the OJB
CVS).
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]