Perhaps I can shed some light on this (or I'm merely restating what you 
already know ;-). The target for generating the test db contains this:

        <!-- 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"/>

These are all targets in the torque build file, i.e. they use torque to do
something.

project-sql-classpath generates SQL for creating the configured
database. For this it processes all files ending on "-schema.xml" (line
449-451 in build-torque.xml) in the ${schemaDirectory} which is configured
in build.properties to be src/schema. As there are two such files
(ojbcore-schema.xml and ojbtest-schema.xml), the generated sql is for both
schemas together. The generated sql is put into ${outputDirectory}/sql
which is target/src/sql

project-create-db-classpath processes the same schema files, generates
database-creation sql (not for the tables) and executes it (e.g. for MySQL
something like "create database ojbtest").

project-datasql-classpath processes the three files ${project}-schema.xml 
(database definition),
${project}-data.dtd (test data dtd) and ${project}-data.xml (actual test
data) with ${project} = ojbtest to generate sql for inserting the test
data into the database. The generated sql is in
${outputDirectory}/sql/${project}-data.sql,
i.e. target/src/sql/ojbtest-data.sql.

project-insert-sql, finally, executes the SQL code found in all .sql files
in the ${outputDirectory}/sql/ directory.

So if you want to process a specific schema only, I suggest you copy it to
some temporary directory ${temp.dir}/schemas, then use the
project-create-db-classpath and project-sql-classpath targets like:

    <copy 
file="${schemaDirectory}/ojbcore-schema.xml" todir="${temp.dir}/schemas"/>

    <ant dir="."
         antfile="${torque.buildFile}"
         target="project-create-db-classpath">
        <property name="schemaDirectory" value="${temp.dir}/schemas"/>
        <property name="outputDirectory" value="${temp.dir}/sql"/>
    </ant>
    <ant dir="."
         antfile="${torque.buildFile}"
         target="project-sql-classpath">
        <property name="schemaDirectory" value="${temp.dir}/schemas"/>
        <property name="outputDirectory" value="${temp.dir}/sql"/>
    </ant>

Hope that helps somewhat.

Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to