db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: db-ojb/forrest/src/documentation/content/xdocs/docu/guides xdoclet-module.xml
Date Sat, 19 Jun 2004 09:42:35 GMT
tomdz       2004/06/19 02:42:35

  Modified:    forrest/src/documentation/content/xdocs/docu/guides
                        xdoclet-module.xml
  Log:
  Documentation update to reflect changes in the torque build file
  
  Revision  Changes    Path
  1.2       +50 -32    db-ojb/forrest/src/documentation/content/xdocs/docu/guides/xdoclet-module.xml
  
  Index: xdoclet-module.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/forrest/src/documentation/content/xdocs/docu/guides/xdoclet-module.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xdoclet-module.xml	17 Jun 2004 12:28:11 -0000	1.1
  +++ xdoclet-module.xml	19 Jun 2004 09:42:35 -0000	1.2
  @@ -264,50 +264,68 @@
   <property file="build.properties"/>
   <property file="mysql.profile"/>]]></source>
               <p>
  -                Now you can create the database with the following ant calls:
  +                Now you can create the database with ant calls similar to these:
               </p>
               <source><![CDATA[
   <target name="init-db" depends="repository-files">
  +    <!-- Torque's build file -->
  +    <property name="torque.buildFile"
  +              value="build-torque.xml"/>
  +
  +    <!-- The name of the database which we're taking from the profile -->
  +    <property name="torque.project"
  +              value="${databaseName}"/>
  +
  +    <!-- Where the schemas (your project and, if required, ojb's internal tables) are
-->
  +    <property name="torque.schema.dir"
  +              value="src/schema"/>
  +
  +    <!-- Build directory of Torque -->
  +    <property name="torque.output.dir"
  +              value="build"/>
  +
  +    <!-- Torque will put the generated sql here -->
  +    <property name="torque.sql.dir"
  +              value="${torque.output.dir}"/>
  +
  +    <!-- Torque shall use the classpath (to find the jdbc driver etc.) -->
  +    <property name="torque.useClasspath"
  +              value="true"/>
  +
  +    <!-- Which jdbc driver to use (again from the profile) -->
  +    <property name="torque.database.driver"
  +              value="${jdbcRuntimeDriver}"/>
  +
  +    <!-- The url used to build the database; note that this may be different
  +         from the url to access the database (e.g. for MySQL) -->
  +    <property name="torque.database.buildUrl"
  +              value="${urlProtocol}:${urlSubprotocol}:${urlDbalias}"/>
  +
  +
  +    <!-- Now we're generating the database sql -->
       <ant dir="."
  -         antfile="build-torque.xml"
  -         target="project-sql-classpath">
  -        <property name="schemaDirectory" value="."/>
  -        <property name="outputDirectory" value="build/db"/>
  +         antfile="${torque.buildFile}"
  +         target="sql">
       </ant>
  +    <!-- Next we create the database -->
       <ant dir="."
  -         antfile="build-torque.xml"
  -         target="project-create-db-classpath">
  -        <property name="schemaDirectory" value="."/>
  -        <property name="outputDirectory" value="build/db"/>
  +         antfile="${torque.buildFile}"
  +         target="create-db">
       </ant>
  +    <!-- And the tables -->
       <ant dir="."
  -         antfile="build-torque.xml"
  -         target="project-insert-sql">
  -        <property name="schemaDirectory" value="."/>
  -        <property name="outputDirectory" value="build/db"/>
  +         antfile="${torque.buildFile}"
  +         target="insert-sql">
       </ant>
   </target>]]></source>
               <p>
  -                As you can see, it is possible (and sometimes advisable) to override properties
for the called tasks.
  -                In the example above, the property
  -                <code>schemaDirectory</code> points to the directory containing
the
  -                <code>*-schema.xml</code> files (note that in the Torque version
that OJB comes with, it is
  -                required that these schema files have this form, otherwise errors occur
when calling any target
  -                in the Torque build file), and
  -                <code>outputDirectory</code> to the directory where torque
will
  -                generate the SQL scripts and puts the log. If you need to manipulate the
directory where the Torque
  -                build script searches for the libraries, then set the
  -                <code>lib.dir</code> property to a directory
  -                containing the libraries. Due to limitations in the Torque build script,
all libraries needed by it
  -                have to be in a single directory.
  -                <br/>
  +                As you can see, the major problem of using Torque is to correctly setup
Torque's build properties.
  +            </p>
  +            <p>
                   One important thing to note here is that the latter two calls modify the
database and in the process
                   remove any existing data, so use them with care. Similar to the above targets,
you can use the
  -                additional targets
  -                <code>project-datadump-classpath</code> for storing the database
data in an XML
  -                file, and
  -                <code>project-datasql-classpath</code> to inserting data from
an XML file into the
  -                database.
  +                additional targets <code>datadump</code> for storing the data
currently in the database in an XML
  +                file, and <code>datasql</code> for inserting the data from
an XML file into the database.
                   <br/>
                   Also, these steps are only valid for the torque that is delivered with
OJB, but probably not for newer
                   or older versions.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message