Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 60465 invoked from network); 24 Jan 2006 21:14:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jan 2006 21:14:00 -0000 Received: (qmail 25927 invoked by uid 500); 24 Jan 2006 21:13:59 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 25906 invoked by uid 500); 24 Jan 2006 21:13:59 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 25895 invoked by uid 500); 24 Jan 2006 21:13:59 -0000 Received: (qmail 25888 invoked by uid 99); 24 Jan 2006 21:13:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2006 13:13:59 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 24 Jan 2006 13:13:58 -0800 Received: (qmail 60257 invoked by uid 65534); 24 Jan 2006 21:13:37 -0000 Message-ID: <20060124211337.60254.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r372022 - in /db/torque/generator/trunk/xdocs: index.xml navigation.xml properties-reference.xml schema-reference.xml Date: Tue, 24 Jan 2006 21:13:37 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tfischer Date: Tue Jan 24 13:13:30 2006 New Revision: 372022 URL: http://svn.apache.org/viewcvs?rev=372022&view=rev Log: - written a new index.xml with an introduction and a usage section - removed the "Torque" from the document titles as it is inserted by maven anyway. Added: db/torque/generator/trunk/xdocs/index.xml Modified: db/torque/generator/trunk/xdocs/navigation.xml db/torque/generator/trunk/xdocs/properties-reference.xml db/torque/generator/trunk/xdocs/schema-reference.xml Added: db/torque/generator/trunk/xdocs/index.xml URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/index.xml?rev=372022&view=auto ============================================================================== --- db/torque/generator/trunk/xdocs/index.xml (added) +++ db/torque/generator/trunk/xdocs/index.xml Tue Jan 24 13:13:30 2006 @@ -0,0 +1,156 @@ + + + + + + Generator Overview + Thomas Fischer + + + +
+ +

+ The Torque generator consists of a collection of ant tasks. The core tasks + generat java classes and sql scripts from an xml description of + the database, but there are other tasks available. See the + Schema Reference for the format of + the xml file, and the + Tasks reference for a complete list + of available tasks. +

+ +

+ The generator can be configured using a properties file, + build.properties. See the + Properties reference for a + list of available properties and their purposes. +

+
+ +
+

+ This section will give a short introduction of how to use the + Torque generator using ant. For using the generator with maven, see the + Maven plugin docs. +

+ +

+ The following is just a suggestion to get you started using the generator. + Once you fond out how it is working, feel free to change the suggestion + to fit your specific needs. +

+ +

+ To use the generator, download the tar.gz or zip binary distribution + of the Torque generator from the + Torque download page. Unpack it in + the root directory of your project. This will create a directory called + torque-gen-3.2 in the root directory of your project. + You also need to have ant + installed and available in your path. +

+ +

+ Change into the torque-gen-3.2 directory and edit the file + build.properties. Look through the properties and + modify them to fit your specific set-up. + Afterwards, assuming you want to keep your schema + files in the src/schema subdirectory of the project + root directory, and generate your java + classes in the target/java and the sql scripts in the + target/sql subdirectories of the project root directory, add + the following properties: + +torque.output.dir = ../target +torque.schema.dir = ../src/schema + +

+ +

+ Now create the src/schema subdirectory of your project + root directory. Create a schema.xml file describing your database in the + newly create directory (for example you might use the + bookstore-schema.xml file from the + Tutorial) for a start. + Note that the names of the schema file(s) needs to end with + schema.xml. +

+ +

+ If you want to use the id broker (a Torque runtime service which creates + primary keys in a database independent manner), also copy the file + torque-gen-3.2/src/schema/id-table-schema.xml to the + src/schema subdirectory of your project root. +

+ +

+ Now change into the torque-gen-3.2 directory, and type + the command +

+ + +ant -f build.xml + + +

+ This will create the target/java subdirectory in your + project root directory containing the generated java classes, + and the target/sql directory containing the generated + sql scripts. +

+ +

+ If you want to create your database using torque (this does not work for + all databases), you first need to copy the database driver jar + into the torque-gen-3.2/lib directory. + Then make sure that the database user you have configured in the + build.properties has sufficient rights to create a database. + When everything is ready, type the command +

+ + +ant -f build.xml create-db + + +

+ To create the tables in your database, you also need the database driver + jar in the torque-gen-3.2/lib directory. Type the command +

+ + +ant -f build.xml insert-sql + + +

+ You can repeat the steps above if you have changed your + schema.xml. However, be aware that the insert-sql task drops + all table and creates them anew, so all data in the tables is lost. +

+ +

+ Now you have finished the short course in using the generator. + To learn about how to use your generated java classes, you can + either look at the Torque Runtime Docs + or continue with the Tutorial at + Step 4, ignoring all + maven-specific parts, especially the bits about a file called + project.xml. (As you use ant, you need to set up your own + project build tasks.) +

+
+ Modified: db/torque/generator/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/navigation.xml?rev=372022&r1=372021&r2=372022&view=diff ============================================================================== --- db/torque/generator/trunk/xdocs/navigation.xml (original) +++ db/torque/generator/trunk/xdocs/navigation.xml Tue Jan 24 13:13:30 2006 @@ -36,6 +36,7 @@ + Modified: db/torque/generator/trunk/xdocs/properties-reference.xml URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/properties-reference.xml?rev=372022&r1=372021&r2=372022&view=diff ============================================================================== --- db/torque/generator/trunk/xdocs/properties-reference.xml (original) +++ db/torque/generator/trunk/xdocs/properties-reference.xml Tue Jan 24 13:13:30 2006 @@ -17,7 +17,7 @@ - Torque - Properties Reference + Properties Reference Stephen Haberman Henning P. Schmiedehausen Modified: db/torque/generator/trunk/xdocs/schema-reference.xml URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/xdocs/schema-reference.xml?rev=372022&r1=372021&r2=372022&view=diff ============================================================================== --- db/torque/generator/trunk/xdocs/schema-reference.xml (original) +++ db/torque/generator/trunk/xdocs/schema-reference.xml Tue Jan 24 13:13:30 2006 @@ -18,7 +18,7 @@ - Torque Schema Reference + Schema Reference Warner Onstine Jason van Zyl Ville Skyttä --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org