db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1345513 - in /db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm: step1-ant.xml step1-maven.xml step2.xml step3-ant.xml step3-maven.xml step4.xml step5.xml step6-ant.xml step6-maven.xml
Date Sat, 02 Jun 2012 14:33:25 GMT
Author: tfischer
Date: Sat Jun  2 14:33:25 2012
New Revision: 1345513

URL: http://svn.apache.org/viewvc?rev=1345513&view=rev
Log:
Tutorial fixes

Modified:
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-ant.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-maven.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step2.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-ant.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-maven.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step4.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step5.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-ant.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-maven.xml

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-ant.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-ant.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-ant.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-ant.xml Sat Jun 
2 14:33:25 2012
@@ -34,7 +34,7 @@
   configure a Torque-based ORM project using ant.
   For this, you need to create ant's build.xml file
   and make the necessary libraries available.
-  It is recommended to run the tutorial against a mysql datanase, as
+  It is recommended to run the tutorial against a mysql database, as
   all of the explanation in this tutorial assumes that you use mysql.
 </p>
 
@@ -55,7 +55,7 @@
   use the following template and save it
   as build.xml in the project's base directory.
   Then edit it to reflect your specific needs
-  (typically you need to change the database urls, 
+  (typically you need to change the database URLs, 
   the database host, the database user and password):
 </p>
 
@@ -93,7 +93,7 @@
         packaging="classpath"
         configPackage="org.apache.torque.templates.sql"
         sourceDir="src/main/schema"
-        newFileTargetDir="target/generated-sql">
+        defaultOutputDir="target/generated-sql">
       <option key="torque.database" value="mysql"/>
     </torque-generator>
   </target>
@@ -160,7 +160,7 @@
 </ul>
 <p>
   A correct ant build file is very important.
-  This enablee the Torque generator to generate all of
+  This enables the Torque generator to generate all of
   the required sources and SQL for your specific
   database.  If you experience problems later in this
   tutorial, it would be wise to double-check this file.

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-maven.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-maven.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-maven.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step1-maven.xml Sat Jun
 2 14:33:25 2012
@@ -31,11 +31,11 @@
 
 <p>
   The following section outlines the necessary steps to
-  configure a Torque-based ORM project using maven.
+  configure a Torque-based ORM project using Maven.
   For this, you need to create maven's pom file
   (the maven project descriptor file) which describes your project.
-  It is recommended to run the tutorial against a mysql datanase, as
-  all of the explanation in this tutorial assumes that you use mysql.
+  It is recommended to run the tutorial against a Mysql database, as
+  all of the explanation in this tutorial assumes that you use Mysql.
 </p>
 
 <p>
@@ -55,7 +55,7 @@
   use the following template and save it as pom.xml
   in the project's base directory.
   Then edit it to reflect your specific needs (
-  typically you need to change the database urls, 
+  typically you need to change the database URLs, 
   the database host, the database user and password):
 </p>
 
@@ -87,6 +87,14 @@
       <groupId>mysql</groupId>
       <version>5.0.4</version>
     </dependency>
+
+    <!-- Logging via log4j -->
+    <dependency>
+      <artifactId>log4j</artifactId>
+      <groupId>log4j</groupId>
+      <version>1.2.16</version>
+    </dependency>
+
   </dependencies>
 
   <build>
@@ -122,8 +130,8 @@
               <packaging>classpath</packaging>
               <configPackage>org.apache.torque.templates.sql</configPackage>
               <sourceDir>src/main/schema</sourceDir>
-              <newFileTargetDir>target/generated-sql</newFileTargetDir>
-              <newFileTargetDirUsage>none</newFileTargetDirUsage>
+              <defaultOutputDir>target/generated-sql</defaultOutputDir>
+              <defaultOutputDirUsage>none</defaultOutputDirUsage>
               <options>
                 <torque.database>mysql</torque.database>
               </options>

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step2.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step2.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step2.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step2.xml Sat Jun  2 14:33:25
2012
@@ -45,7 +45,7 @@
   In this directory, you will create the file <em>bookstore-schema.xml</em>
   which defines your database schema. The name of
   your database schema file must end with
-  &#145;schema.xml&#146; because Torque will only
+  <em>schema.xml</em> because Torque will only
   generate object models for files ending with that
   pattern.
 </p>
@@ -55,9 +55,9 @@
   database that might be used to support a bookstore
   application.  The database will contain three
   tables: author, publisher, and book.  The first
-  table will contain author information (first
-  and last name).  The second table will
-  contain publisher information (name).  And the third
+  table will contain publisher information (name).
+  The second table will contain author information (first
+  and last name).  And the third
   table will contain book information (title, and
   ISBN).  The author id and publisher id will be
   foreign keys in the book table.  The schema
@@ -181,6 +181,14 @@
     <th>Description</th>
   </tr>
   <tr>
+    <td>native</td>
+    <td>
+      Instructs Torque to use the underlying
+      database's mechanism to generate IDs (varies
+      per database e.g. autoincrement for mysql and schemata for postgresql).
+    </td>
+  </tr>
+  <tr>
     <td>idbroker</td>
     <td>
       Instructs Torque to use its
@@ -190,14 +198,6 @@
     </td>
   </tr>
   <tr>
-    <td>native</td>
-    <td>
-      Instructs Torque to use the underlying
-      database's mechanism to generate IDs (varies
-      per database e.g. autoincrement for mysql and schemata for postgresql).
-    </td>
-  </tr>
-  <tr>
     <td>none</td>
     <td>
       Instructs Torque to not generate IDs.
@@ -219,19 +219,19 @@
 <p>
   Another common mistake is to forget that XML is
   <b>case-sensitive</b>.  All of the elements and
-  attributes must be specified according to the TODO
-  <a href="TODO">DTD</a>
+  attributes must be specified according to the 
+  <a href="../../documentation/modules/templates/database-4-0-strict.xsd">XML Schema</a>
   for the database schema.  In addition, you should
-  include the XML declaration and DTD specification in
-  your database schema file.
+  include the XML declaration and XML schema specification
+  in your database schema file.
   This helps to detect errors in the schema file easily.
 </p>
 
 <p>
   For additional information on
   the XML elements and attributes, please refer to the
-  <a href="../generator/schema-reference.html">
-  Torque Schema Reference</a>.
+  <a href="../../documentation/modules/templates/database-4-0-strict.xsd">
+  Torque Schema XSD</a>.
 </p>
 
 </section>

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-ant.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-ant.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-ant.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-ant.xml Sat Jun 
2 14:33:25 2012
@@ -49,13 +49,15 @@
 </p>
 
 <p>
-  The object model consists of four classes for each
+  The object model consists of eight classes for each
   table in your schema.  For example, the
   <em>author</em> table, defined in this tutorial,
   will result in the following four classes:
-  <em>Author</em>, <em>AuthorPeer</em>,
-  <em>BaseAuthor</em>, and <em>BaseAuthorPeer</em> (a
-  discussion on the use of these classes is deferred
+  <em>Author</em>, <em>AuthorPeer</em>, 
+  <em>AuthorPeerImpl</em>, <em>AuthorPeerRecordMapper</em>,
+  <em>BaseAuthor</em>, <em>BaseAuthorPeer</em>, 
+  <em>BaseAuthorPeerImpl</em>, and <em>BaseAuthorPeerRecordMapper</em>.
+  (a discussion on the use of these classes is deferred
   until we write our sample application).
 </p>
 
@@ -139,8 +141,8 @@ ant generate
   to create tables. Alternatively, you can just use the root user
   to create the database tables.
   In both cases, check again that the username, password and url
-  of your mysql database is correct in the build.xml, and type the following command in
-  the top-level directory of your project:
+  of your mysql database is correct in the build.xml,
+  and type the following command in the top-level directory of your project:
 </p>
 
 <source><![CDATA[
@@ -149,13 +151,20 @@ ant execute-sql
 
 <p>
   Success will be indicated by the message 
-  8 of 8 SQL statements executed successfully
-  BUILD SUCCESSFUL;.  You can also validate
-  this by checking your database using the sql commands
-  use bookstore; show tables;.
-  For example, the <em>bookstore-schema.xml</em> defined in this
+  8 of 10 SQL statements executed successfully
+  BUILD SUCCESSFUL.
+  (Torque assumes that you already have defined a database,
+  and performs a drop before attempting recreation.
+  The statements dropping the foreign keys fail because 
+  the table does not exist, but this is not a problem
+  for creating the tables. If you re-run the command,
+  all 10 statements will execute successfully.)
+  You can also validate that the tables were created
+  by checking your database.  For example, the
+  <em>bookstore-schema.xml</em> defined in this
   tutorial should have created the following tables:
-  <em>author</em>, <em>book</em>, and <em>publisher</em>.
+  <em>author</em>, <em>book</em>,
+  and <em>publisher</em>.
 </p>
 
 <p>

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-maven.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-maven.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-maven.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step3-maven.xml Sat Jun
 2 14:33:25 2012
@@ -30,7 +30,7 @@
 <section name="Step 3: Invoking the Torque Maven Plugin">
 
 <p>
-  With the configuration of maven and definition of the
+  With the configuration of Maven and definition of the
   database schema completed, you can now
   generate the object model to support your database,
   and create the database tables.
@@ -49,13 +49,15 @@
 </p>
 
 <p>
-  The object model consists of four classes for each
+  The object model consists of eight classes for each
   table in your schema.  For example, the
   <em>author</em> table, defined in this tutorial,
   will result in the following four classes:
-  <em>Author</em>, <em>AuthorPeer</em>,
-  <em>BaseAuthor</em>, and <em>BaseAuthorPeer</em> (a
-  discussion on the use of these classes is deferred
+  <em>Author</em>, <em>AuthorPeer</em>, 
+  <em>AuthorPeerImpl</em>, <em>AuthorPeerRecordMapper</em>,
+  <em>BaseAuthor</em>, <em>BaseAuthorPeer</em>, 
+  <em>BaseAuthorPeerImpl</em>, and <em>BaseAuthorPeerRecordMapper</em>.
+  (a discussion on the use of these classes is deferred
   until we write our sample application).
 </p>
 
@@ -70,7 +72,7 @@ mvn generate-sources
 
 <p>
   A successful build will be indicated by the
-  &#145;BUILD SUCCESSFUL&#146; message.
+  BUILD SUCCESSFUL message.
 </p>
 
 <p>
@@ -137,7 +139,7 @@ mvn generate-sources
 
 <p>
   The tutorial uses mysql as database, and the pom templates
-  gicen in step 1 already include a mysql dependency,
+  given in step 1 already include a mysql dependency,
   so the pom xml in the tutorial project can remain unchanged.
 </p>
 
@@ -169,9 +171,16 @@ maven sql:execute
 
 <p>
   Success will be indicated by the message 
-  8 of 8 SQL statements executed successfully
-  &#145;BUILD SUCCESSFUL&#146;.  You can also validate
-  this by checking your database.  For example, the
+  8 of 10 SQL statements executed successfully
+  BUILD SUCCESSFUL.
+  (Torque assumes that you already have defined a database,
+  and performs a drop before attempting recreation.
+  The statements dropping the foreign keys fail because 
+  the table does not exist, but this is not a problem
+  for creating the tables. If you re-run the command,
+  all 10 statements will execute successfully.)
+  You can also validate that the tables were created
+  by checking your database.  For example, the
   <em>bookstore-schema.xml</em> defined in this
   tutorial should have created the following tables:
   <em>author</em>, <em>book</em>,

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step4.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step4.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step4.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step4.xml Sat Jun  2 14:33:25
2012
@@ -47,10 +47,7 @@
   executing the object model code generated by Torque.
   The runtime properties control database
   parameters such as drivers, usernames, and
-  passwords.  These properties can be saved in any
-  file because your application must explicitly
-  initialize Torque (as you'll see later in this
-  tutorial).
+  passwords.
 </p>
 
 <p>

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step5.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step5.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step5.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step5.xml Sat Jun  2 14:33:25
2012
@@ -37,44 +37,56 @@ the power of Torque.
 
 <p>
 As mentioned earlier, when Torque created your object
-model, it created four Java classes for each table
+model, it created eight Java classes for each table
 defined in your database schema.  For example, the
 <em>book</em> table, defined in the database schema
 presented earlier, will result in the following classes:
-<em>Book</em>, <em>BookPeer</em>, <em>BaseBook</em>,
and
-<em>BaseBookPeer</em>.
+<em>Book</em>, <em>BookPeer</em>, 
+<em>BookPeerImpl</em>, <em>BookRecordMapper</em>,
+<em>BaseBook</em>, <em>BaseBookPeer</em>, 
+<em>BaseBookPeerImpl</em>, and <em>BaseBookRecordMapper</em>.
 </p>
 
 <p>
-<em>Book</em> and <em>BookPeer</em> are subclasses of
-<em>BaseBook</em> and <em>BaseBookPeer</em>
-respectively.  The two Base classes (<em>BaseBook</em>
-and <em>BaseBookPeer</em>) contain Torque-generated
+<em>Book</em>, <em>BookPeer</em>, <em>BookPeerImpl</em>
and
+<em>BookRecordMapper</em> are subclasses of
+<em>BaseBook</em>, <em>BaseBookPeer</em>
+<em>BaseBookPeerImpl</em> and <em>BaseBookRecordMapper</em>, respectively.
+<em>BookPeer</em> and <em>BaseBookPeer</em> are simply static wrappers
+of <em>BookPeerImpl</em> and <em>BaseBookPeerImpl</em>.
+The four Base classes (<em>Base*</em>) contain Torque-generated
 logic and should <b>not</b> be modified because Torque
 will overwrite your changes if you happen to generate
-your object model again.  Any
-business logic that you might want to add should be
-placed in the <em>Book</em> and <em>BookPeer</em>
-classes.  This is covered later in the tutorial.
+your object model again.
+Any business logic that you might want to add should be
+placed in the <em>Book</em> and either <em>BookPeerImpl</em> 
+or <em>BookPeer</em> classes (this is covered later in the tutorial).
 </p>
 
 <p>
 You might be asking yourself, what is the difference
-between the Peer classes (<em>BookPeer</em> and
-<em>BaseBookPeer</em>) and their counterparts
-(<em>Book</em> and <em>BaseBook</em>), also known as
-Data Objects?  The Peer classes "wrap" their
-associated database tables and provide static methods to
-manipulate those tables such as <em>doSelect</em> and
-<em>doDelete</em>.  Data Objects,
-on the other hand, "wrap" individual rows
-within those tables and provide getters/mutators for each
+between the BookPeer, BookPeerImpl, BookRecordMapper and Book classes?
+The BookPeer and BookPeerImpl classes provide the same functionality,
+with the difference that the Peer classes provide static access to
+methods for manipulating tables while the PeerImpl classes
+contain the implementation of those methods. This allows
+the implementation to be exchanged after compilation 
+(e.g. for testing purposes).
+If you do not need to exchange the implementation of the Peer classes,
+you need not bother about the PeerImpl classes 
+and simply use the Peer classes.
+The Book class (also known as "Data Object" class), "wrap" individual rows
+within the tables and provide getters/mutators for each
 column defined in those tables as well as a
-<em>save</em> method.  Both Peer and Data Objects have a
-one-to-one mapping to a table defined in your database
+<em>save</em> method.
+The RecordMapper classes map between JDBC Rows and the Data objects
+(chances are that you never use these directly).
+So the two of the eight classes you will probably be working with are the
+Peer classes (wrapping the table) and Data Objects (wrapping a table row)
+These have a one-to-one mapping to a table defined in your database
 schema.  For a more in-depth discussion on Peers and
 Data Objects, refer to the
-<a href="../runtime/documentation/relevant-classes.html">Runtime relevant classes documentation</a>.
+<a href="../../documentation/modules/runtime/reference/relevant-classes.html">Runtime
relevant classes documentation</a>.
 An example of adding logic to both the Peer and Data
 Objects is presented later in the tutorial.
 </p>
@@ -260,9 +272,19 @@ for (Book book : books)
       method to query and populate Data Objects
       for an entire table with foreign-keys (one
       query for the table, then two additional
-      queries for each row).  A single query using
-      a join would be much more efficient.  As a
-      convenience, Torque generates the following
+      queries for each row).  Two single queries 
+      for selecting all associated authors respectively
+      publishers would be much more efficient.
+      As a convenience, Torque can generate filler methods
+      which do exactly this: pass in a list of books
+      retrieve all associated books resp. publishers
+      and fill the cached authors resp. publishers in the book objects.
+      For generating these methods, you need to set
+      the switch <em>torque.om.complexObjectModel.generateFillers</em>
+      to <em>true</em> when generating the classes.
+      <br/>
+      As an alternative, for selects using joins,
+      there are the following
       <em>protected</em> methods in the BasePeer
       classes whose tables contain foreign-keys:
       <em>doSelectJoinTable</em> where
@@ -292,18 +314,19 @@ for (Book book : books)
 <p>
   To select a specific <em>Book</em> from the table,
   create a <em>Criteria</em> object (or just reuse the
-  previous one) and use the <em>add</em> method to
-  specify some criteria.  Specifying criteria is
+  previous one) and use the <em>where</em> methods to specify
+  a condition.
+  Specifying a condition is
   simply a matter of choosing a column (defined as
   static constants in your Peer class) and some value
   you want to match.  Thus, selecting a book with the
-  following ISBN, &#145;0-618-12902-2&#146;, is as
+  following ISBN, <em>0-618-12902-2</em>, is as
   simple as:
 </p>
 
 <source><![CDATA[
 Criteria crit = new Criteria();
-crit.add(BookPeer.ISBN, "0-618-12902-2");
+crit.where(BookPeer.ISBN, "0-618-12902-2");
 List<Book> books = BookPeer.doSelect(crit);
 ]]></source>
 
@@ -313,7 +336,8 @@ List<Book> books = BookPeer.doSelect(cri
   used to specify very simple to very complex queries.
   For a much more in-depth discussion of
   <em>Criteria</em>, please refer to the
-  <a href="../runtime/reference/documentation/read-from-db.html">reading from the database
Reference</a>.
+  <a href="../../documentation/modules/runtime/reference/read-from-db.html">Reading
+  from the Database Reference</a>.
 </p>
 
 </section>
@@ -335,7 +359,7 @@ List<Book> books = BookPeer.doSelect(cri
 
 <p>
   For example, changing the author of the
-  &#145;Effective Java&#146; book created earlier is
+  <em>Effective Java</em> book created earlier is
   as simple as:
 </p>
 
@@ -395,34 +419,6 @@ PublisherPeer.doDelete(addison);
   <em>author</em> and <em>publisher</em> tables.
 
 </p>
-
-<table>
-  <tr> <th>The Gory Details (not for the faint)</th></tr>
-  <tr>
-    <td>
-      It should also be noted that
-      <em>doDelete</em> does not construct its
-      WHERE clause in a similar manner as the
-      <em>doSelect</em> method.  <em>doDelete</em>
-      processes <em>Criteria</em> in a more
-      primitive fashion.  Specifically,
-      <em>Criteria</em> assembled using the
-      <em>and</em> and <em>or</em> methods (not
-      covered in this tutorial) are effectively
-      ignored.  In addition, passing an empty
-      <em>Criteria</em> to <em>doDelete</em> will
-      not delete all of the rows from a table.  In
-      summary, you cannot assume that a
-      <em>Criteria</em> object which successfully
-      selects rows from a table via
-      <em>doSelect</em> will delete those rows if
-      passed to <em>doDelete</em>.  In the future,
-      <em>doDelete</em> may be modified to be
-      consistent in the handling of
-      <em>Criteria</em> objects.
-    </td>
-  </tr>
-</table>
 </section>
 
 <section name="Adding Functionality to the Object Model">
@@ -430,11 +426,11 @@ PublisherPeer.doDelete(addison);
 <p>
   This section will provide examples of adding
   functionality to both the Peer and Data Object
-  classes.  As you may recall, Torque generated four
+  classes.  As you may recall, Torque generated eight
   classes for each table defined in the database
-  schema.  Two of these classes (the Base Data Object
-  and Base Peer class) contain Torque-generated logic
-  while the other two are empty subclasses that you
+  schema.  Four of these classes (the Base classes)
+  contain Torque-generated logic
+  while the other ones are empty subclasses that you
   can use to include business logic.  By now, you
   should have a decent understanding of the type of
   logic that might be added to these classes.  Keep in
@@ -509,7 +505,7 @@ public class Publisher extends BasePubli
   The next change that we'll make is to the Peer
   classes.  For convenience (and based on the
   suggestion in the
-  <a href="../runtime/reference/documentation/read-from-db.html">Reading
+  <a href="../../documentation/modules/runtime/reference/read-from-db.html">Reading
   from the Database Reference</a>) we'll add <em>doSelectAll</em>
   methods which will return a List of all the Data
   Objects in a table.  The following are the modified
@@ -524,7 +520,7 @@ package org.apache.torque.tutorial.om;
 
 import java.util.List;
 import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.criteria.Criteria;
 
 public class BookPeer extends BaseBookPeer
 {
@@ -540,7 +536,7 @@ package org.apache.torque.tutorial.om;
 
 import java.util.List;
 import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.criteria.Criteria;
 
 public class AuthorPeer extends BaseAuthorPeer
 {
@@ -556,7 +552,7 @@ package org.apache.torque.tutorial.om;
 
 import java.util.List;
 import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.criteria.Criteria;
 
 public class PublisherPeer extends BasePublisherPeer
 {
@@ -601,9 +597,11 @@ import java.io.InputStream;
 import java.util.List;
 
 import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.log4j.*;
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 import org.apache.torque.Torque;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.criteria.Criteria;
 
 public class Bookstore
 {
@@ -678,7 +676,7 @@ public class Bookstore
              */
             System.out.println("Booklist (specific ISBN):\n");
             Criteria crit = new Criteria();
-            crit.add(BookPeer.ISBN, "0-201-63346-9");
+            crit.where(BookPeer.ISBN, "0-201-63346-9");
             booklist = BookPeer.doSelect(crit);
             printBooklist(booklist);
 
@@ -701,12 +699,12 @@ public class Bookstore
              * specified criteria.
              */
             crit = new Criteria();
-            crit.add(BookPeer.ISBN, "0-618-12902-2");
+            crit.where(BookPeer.ISBN, "0-618-12902-2");
             BookPeer.doDelete(crit);
 
             crit = new Criteria();
-            crit.add(BookPeer.ISBN, "0-201-63346-9");
-            crit.add(BookPeer.TITLE, "TCP/IP Illustrated, Volume 1");
+            crit.where(BookPeer.ISBN, "0-201-63346-9");
+            crit.and(BookPeer.TITLE, "TCP/IP Illustrated, Volume 1");
             BookPeer.doDelete(crit);
 
             /*

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-ant.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-ant.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-ant.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-ant.xml Sat Jun 
2 14:33:25 2012
@@ -40,7 +40,8 @@
   in the top level directory of the project.
   Add all libraries from the lib dir of the torque-runtime binary distribution
   and also the torque-runtime-${version}.jar from its root directory.
-  Additionally copy the mysql driver jar from lib/ant to lib/runtime.
+  Additionally copy the mysql driver jar and the log4j jar 
+  from lib/ant to lib/runtime.
 </p>
 
 <p>
@@ -96,10 +97,10 @@ ant
 
 <source><![CDATA[
 linux:
-java -cp target/classes:lib/runtime/commons-beanutils-1.7.0.jar:lib/runtime/commons-dbcp-1.2.2.jar:lib/runtime/commons-collections-3.2.jar:lib/runtime/commons-configuration-1.4.jar:lib/runtime/commons-lang-2.3.jar:lib/runtime/commons-logging-1.1.jar:lib/runtime/commons-pool-1.3.jar:lib/runtime/log4j-1.2.11.jar:lib/runtime/mysql-connector-java-5.0.4.jar:lib/runtime/torque-runtime-4.0-alpha1-SNAPSHOT.jar:lib/runtime/village-3.3.jar
org.apache.torque.tutorial.om.Bookstore
+java -cp target/classes:lib/runtime/commons-beanutils-core-1.8.0.jar:lib/runtime/commons-dbcp-1.3.jar:lib/runtime/commons-collections-3.2.1.jar:lib/runtime/commons-configuration-1.6.jar:lib/runtime/commons-lang-2.6.jar:lib/runtime/commons-logging-1.1.1.jar:lib/runtime/commons-pool-1.5.6.jar:lib/runtime/log4j-1.2.16.jar:lib/runtime/mysql-connector-java-5.0.4.jar:lib/runtime/torque-runtime-4.0-alpha1-SNAPSHOT.jar
org.apache.torque.tutorial.om.Bookstore
 
 windows:
-java -cp target/classes;lib/runtime/commons-beanutils-1.7.0.jar;lib/runtime/commons-dbcp-1.2.2.jar;lib/runtime/commons-collections-3.2.jar;lib/runtime/commons-configuration-1.4.jar;lib/runtime/commons-lang-2.3.jar;lib/runtime/commons-logging-1.1.jar;lib/runtime/commons-pool-1.3.jar;lib/runtime/log4j-1.2.11.jar;lib/runtime/mysql-connector-java-5.0.4.jar;lib/runtime/torque-runtime-4.0-alpha1-SNAPSHOT.jar;lib/runtime/village-3.3.jar
org.apache.torque.tutorial.om.Bookstore
+java -cp target/classes;lib/runtime/commons-beanutils-core-1.8.0.jar;lib/runtime/commons-dbcp-1.3.jar;lib/runtime/commons-collections-3.2.1.jar;lib/runtime/commons-configuration-1.6.jar;lib/runtime/commons-lang-2.6.jar;lib/runtime/commons-logging-1.1.1.jar;lib/runtime/commons-pool-1.5.6.jar;lib/runtime/log4j-1.2.16.jar;lib/runtime/mysql-connector-java-5.0.4.jar;lib/runtime/torque-runtime-4.0-alpha1-SNAPSHOT.jar
org.apache.torque.tutorial.om.Bookstore
 
 ]]></source>
 

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-maven.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-maven.xml?rev=1345513&r1=1345512&r2=1345513&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-maven.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/tutorial/orm/step6-maven.xml Sat Jun
 2 14:33:25 2012
@@ -38,7 +38,7 @@
   in the top level directory of the project.
   You already created this file in step 1 of the
   tutorial; and it already contains the dependencies
-  to the Torque runtime and the mysql driver,
+  to the Torque runtime, the mysql driver, and log4j,
   so nothing needs to be changed there.
 </p>
 
@@ -101,10 +101,10 @@ mvn package
 
 <source><![CDATA[
 linux:
-java -cp classes:dependency/commons-dbcp-1.2.2.jar:dependency/commons-collections-3.2.jar:dependency/commons-configuration-1.4.jar:dependency/commons-lang-2.3.jar:dependency/commons-logging-1.1.jar:dependency/commons-pool-1.3.jar:dependency/log4j-1.2.11.jar:dependency/mysql-connector-java-5.0.4.jar:dependency/torque-runtime-4.0-alpha1-SNAPSHOT.jar:dependency/village-3.3.jar
org.apache.torque.tutorial.Bookstore
+java -cp classes:dependency/commons-beanutils-core-1.8.0.jar:dependency/commons-dbcp-1.3.jar:dependency/commons-collections-3.2.1.jar:dependency/commons-configuration-1.6.jar:dependency/commons-lang-2.6.jar:dependency/commons-logging-1.1.1.jar:dependency/commons-pool-1.5.6.jar:dependency/log4j-1.2.16.jar:dependency/mysql-connector-java-5.0.4.jar:dependency/torque-runtime-4.0-alpha1-SNAPSHOT.jar
org.apache.torque.tutorial.om.Bookstore
 
 windows:
-java -cp classes;dependency/commons-dbcp-1.2.2.jar;dependency/commons-collections-3.2.jar;dependency/commons-configuration-1.4.jar;dependency/commons-lang-2.3.jar;dependency/commons-logging-1.1.jar;dependency/commons-pool-1.3.jar;dependency/log4j-1.2.11.jar;dependency/mysql-connector-java-5.0.4.jar;dependency/torque-runtime-4.0-alpha1-SNAPSHOT.jar;dependency/village-3.3.jar
org.apache.torque.tutorial.Bookstore
+java -cp classes;dependency/commons-beanutils-core-1.8.0.jar;dependency/commons-dbcp-1.3.jar;dependency/commons-collections-3.2.1.jar;dependency/commons-configuration-1.6.jar;dependency/commons-lang-2.6.jar;dependency/commons-logging-1.1.1.jar;dependency/commons-pool-1.5.6.jar;dependency/log4j-1.2.16.jar;dependency/mysql-connector-java-5.0.4.jar;dependency/torque-runtime-4.0-alpha1-SNAPSHOT.jar
org.apache.torque.tutorial.om.Bookstore
 
 ]]></source>
 



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


Mime
View raw message