db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1351566 - in /db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference: initialisation-configuration.xml read-from-db.xml
Date Tue, 19 Jun 2012 04:03:32 GMT
Author: tfischer
Date: Tue Jun 19 04:03:32 2012
New Revision: 1351566

URL: http://svn.apache.org/viewvc?rev=1351566&view=rev
Log:
Documentation improvements

Modified:
    db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
    db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/read-from-db.xml

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml?rev=1351566&r1=1351565&r2=1351566&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
(original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/initialisation-configuration.xml
Tue Jun 19 04:03:32 2012
@@ -49,29 +49,35 @@
     
     <p>
       Upon initialisation, also the runtime model of the database,
-      i.e. the <code>DatabaseMaps</code>, are built by autogenerated
+      i.e. the <code>DatabaseMaps</code>, are built by generated
       <code>MapBuilder</code> classes.  This happens automatically,
       so usually you need not bother about it.
     </p>
     
     <p>
-      The detailed procedure is the following: Each peer class registers
-      its Map builder with the Torque runtime when the Base Peer Class is loaded
+      The detailed procedure is the following: Each peer class loads
+      its Map builder class when the Base Peer Class is loaded
+      by accessing the static constants of the Map builder class
       (Usually, a peer class is loaded if one of the constants
       for a column name is accessed, or a method is called).
-      If Torque is already initialized when the Peer class is loaded
-      (this is usually the case) the Map Builder builds the database map
-      instantly and makes it avaliable to Torque. If Torque is not yet
-      initialized, the Peer class stores the Map Builder with Torque,
-      which builds the database Map when Torque is initialized.
+      The Map builder class then passes the table information
+      to the Torque runtime.
+    </p>
+    <p>
+      If the property <code>torque.om.generateMapInit</code>
+      was set to true while generating the torque classes,
+      the map builder will then also load the map builder classes
+      for all other tables in the same database, which will then register all
+      tables in the database.
     </p>
     
     <p>
-      This means that you will not see a table in the database map if
+      This means that possibly you will not see a table in the database map if
       its peer class is not loaded.  If you want to make sure that all
-      tables appear in the Database map, call the Database Map's
-      initialize() method. This method triggers a generated class
-      to insert all tables into the database map.
+      tables appear in the Database map, set the property 
+      <code>torque.om.generateMapInit</code> to true when generating
+      the torque classes, and then call the <code>initDatabaseMap()</code>
+      method of any generated map builder class.
     </p>
 
   </section>
@@ -108,11 +114,8 @@ torque.database.default=bookstore
     <subsection name="Database Adapters">
 
       <p>
-        Previously, Torque provided an internal map between many Drivers 
-        and a set of adapter classes which are used to account for 
-        differences among databases.
-        This arrangement is no longer possible using <code>DataSource</code>,

-        so the adapter must be given in the configuration.
+        For each database handle, an adapter must be configured 
+        (adapters are used to account for differences among databases).
         The adapter property is given as:
       </p>
 
@@ -144,7 +147,7 @@ torque.database.bookstore.adapter=mysql
       </table>
       
       <p>
-        For application in environments that should support different databases
+        For application in environments that should support different databases,
         you can use the special adapter <code>auto</code>, which tries to
         detect the correct adapter type from JDBC metadata.
       </p>
@@ -169,17 +172,17 @@ torque.database.bookstore.adapter.myadap
       <p>
         Torque can use any connection pool implementing the interface
         <code>DataSource</code>.  Torque expects a factory that can return a

-        <code>DataSource</code> and can be configured using Torque's
+        <code>DataSource</code> which can be configured using Torque's
         configuration file.
       </p>
 
       <p>
         Torque provides factories to use the commons-dbcp pools as well as a 
-        general factory that uses jndi to retrieve the <code>DataSource</code>.
-        The jndi factory looks up a <code>DataSource</code> bound to jndi; it
+        general factory that uses JNDI to retrieve the <code>DataSource</code>.
+        The JNDI factory looks up a <code>DataSource</code> bound to JNDI; it
         also provides a simple property file based way to configure and deploy most
         <code>DataSource</code>'s, though in many cases a pool may already be
-        bound to jndi and torque only needs to use it.
+        bound to JNDI and torque only needs to use it.
       </p>
 
     </subsection>
@@ -191,7 +194,7 @@ torque.database.bookstore.adapter.myadap
     <p>
       This factory uses the SharedDataSource available in the
       commons-dbcp package. SharedPoolDataSourceFactory provides an easy way
-      to configure this pool and it assumes you will have a jdbc Driver class
+      to configure this pool and it assumes you will have a JDBC Driver class
       providing the physical database connections.  Again, you must let 
       Torque know you are using this factory:
     </p>
@@ -241,8 +244,8 @@ torque.dsfactory.bookstore.pool.validati
 
     <p>
       This factory is used if the <code>DataSource</code> is to be available

-      via jndi.  It is possible to use this factory to deploy a
-      <code>DataSource</code> into jndi, but in many cases for using this 
+      via JNDI.  It is possible to use this factory to deploy a
+      <code>DataSource</code> into JNDI, but in many cases for using this 
       factory the <code>DataSource</code> is already deployed. 
       This factory is specified with the following property:
     </p>
@@ -257,15 +260,15 @@ torque.dsfactory.bookstore.factory = \
     
       <p>
         In this section, it is assumed that a <code>DataSource</code>
-        is available via jndi.  Usually, a J2EE environment can be configured
-        to bind a <code>DataSource</code> into jndi for further use.
-        For example, Tomcat can bind a <code>DataSource</code> into jndi, see
+        is available via JNDI.  Usually, a J2EE environment can be configured
+        to bind a <code>DataSource</code> into JNDI for further use.
+        For example, Tomcat can bind a <code>DataSource</code> into JNDI, see
         <a href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html">the
Tomcat Documentation</a>
         for details.
       </p>
 
       <p>
-        If a pool is known to already be available via jndi, 
+        If a pool is known to already be available via JNDI, 
         only one more property is required for Torque:
       </p>
 
@@ -275,7 +278,7 @@ torque.dsfactory.bookstore.jndi.path=jdb
 
       <p>
         This line defines the string that will be used to lookup the
-        <code>DataSource</code> within the default jndi 
+        <code>DataSource</code> within the default JNDI 
         <code>InitialContext</code>.
         If everything is configured and the default <code>InitialContext</code>
         contains the <code>DataSource</code>, this is all that is
@@ -301,7 +304,7 @@ torque.dsfactory.bookstore.jndi.java.nam
       </p>
 
       <p>
-        One of the advantages of jndi is that it supports changing
+        One of the advantages of JNDI is that it supports changing
         the <code>DataSource</code> on the fly.
         On the other hand this means that the actual <code>DataSource</code>
         object must be looked up in the context with every database operation.
@@ -322,22 +325,22 @@ torque.dsfactory.bookstore.jndi.ttl=6000
 
     </subsection>
 
-    <subsection name="Using Torque to bind a pool to jndi">
+    <subsection name="Using Torque to bind a pool to JNDI">
 
       <p>
         Generally a J2EE environment such as a servlet engine or application
         server is expected to provide a jdbc2 compatible connection pool.
         If your application is not running within such an environment,
-        or even if it is and torque is your only use of a connection pool,
+        or even if it is and Torque is your only use of a connection pool,
         Torque provides a simple properties file method of configuring a
-        <code>DataSource</code> and deploying it via jndi.
+        <code>DataSource</code> and deploying it via JNDI.
       </p>
       
       <p>
-        Too use this feature, you need to specify the jndi configuration 
-        parameters as shown above, setting the factory and the jndi path.
+        Too use this feature, you need to specify the JNDI configuration 
+        parameters as shown above, setting the factory and the JNDI path.
         In addition to that, you need to configure
-        the <code>DataSource</code> which should be bound into jndi.
+        the <code>DataSource</code> which should be bound into JNDI.
         The one property that is necessary for all <code>DataSource</code>'s

         is the classname of the <code>DataSource</code> implementation.
         Beyond that the properties are implementation specific, depending on the

Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/read-from-db.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/read-from-db.xml?rev=1351566&r1=1351565&r2=1351566&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/read-from-db.xml
(original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/documentation/modules/runtime/reference/read-from-db.xml
Tue Jun 19 04:03:32 2012
@@ -38,6 +38,24 @@
       Criteria object to a Peer class, which will query the database 
       and convert the retrieved table rows into Data Objects.
     </p>
+    <p>
+      Note that there are two criteria classes in the runtime:
+      <code>org.apache.torque.criteria.Criteria</code> and 
+      <code>org.apache.torque.util.Criteria</code>.
+      The former is recommended for new projects, the latter is deprecated
+      but can be used for legacy projects. 
+      Apart from obvious API differences, there are a few subtle semantics
+      differences between the two classes. 
+      Check the <a href="../../../migration-from-torque-3.html">migration guide</a>
+      for details.
+    </p>
+    <p>
+      All following examples are using generated classes 
+      (AuthorPeer, author, BookPeer, Book,...)from the
+      <a href="../../../tutorial/orm/index.html">ORM tutorial</a>.
+      Please generate those classes following the tutorial if you want to try
+      these examples.
+    </p>
 
   </section>
 
@@ -78,7 +96,7 @@ List authors = AuthorPeer.doSelect(criti
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.LAST_NAME, "Stevens");
+criteria.where(AuthorPeer.LAST_NAME, "Stevens");
 List authors = AuthorPeer.doSelect(criteria);
 </source>
 
@@ -131,7 +149,7 @@ List authors = AuthorPeer.doSelect(crite
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.AUTHOR_ID, 5, Criteria.LESS_THAN);
+criteria.where(AuthorPeer.AUTHOR_ID, 5, Criteria.LESS_THAN);
 List authors = AuthorPeer.doSelect(criteria);
 </source>
 
@@ -251,7 +269,7 @@ public List doSelectJoinBooks(Criteria c
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.LAST_NAME, "Stevens");
+criteria.where(AuthorPeer.LAST_NAME, "Stevens");
 List authorAndBooks = AuthorPeer.doSelectJoinBooks(criteria);
 </source>
 
@@ -268,8 +286,8 @@ List authorAndBooks = AuthorPeer.doSelec
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.LAST_NAME, "Stevens");
-criteria.add(BookPeer.NAME, "TCP/IP Illustrated, Volume 1");
+criteria.where(AuthorPeer.LAST_NAME, "Stevens");
+criteria.and(BookPeer.NAME, "TCP/IP Illustrated, Volume 1");
 List authorAndBooks = AuthorPeer.doSelectJoinBooks(criteria);
 </source>
 
@@ -286,7 +304,7 @@ List authorAndBooks = AuthorPeer.doSelec
         more than one foreign key relation apart.  For example,
         if a table A has a foreign key reference to a table B,
         which has a foreign key reference to a table C, there is no way
-        to read the data in table A and the related datasests in table B
+        to read the data in table A and the related datasets in table B
         <em>and</em> table C in one single select.
       </p>
       
@@ -314,6 +332,11 @@ List bookAuthors = AuthorPeer.doSelect(c
       <p>
         This method creates a so called "inner join", i.e. only author entries
         which have a corresponding book entry are selected.
+        Note that the author would appear 
+        for every book that is attached to it. 
+        If an author has published 10 books, the author would appear
+        in the returned List 10 times 
+        (see the section &quot;Using DISTINCT&quot; below for a solution).
       </p>
 
       <table>
@@ -322,7 +345,7 @@ List bookAuthors = AuthorPeer.doSelect(c
         </tr>
         <tr>
           <td>
-            Also, in SQL, there are two different ways to state an inner join.
+            In SQL, there are two different ways to state an inner join.
             The first way is a statement like
 <source>
 SELECT BOOK.* FROM BOOK INNER JOIN AUTHOR ON BOOK.AUTHOR_ID=AUTHOR.AUTHOR_ID
@@ -411,7 +434,7 @@ List authors = AuthorPeer.doSelect(crite
   <section name="Fillers">
 
     <p>
-      A very effisiont way of reading corresponding objects for a set of
+      A very efficient way of reading corresponding objects for a set of
       data objects is to query all corresponding objects in one query using
       IN. E.g. if you have three authors with the ids 1,3 and 7 and want to
       read the related books, you can use the SQL statement
@@ -445,7 +468,7 @@ List authors = AuthorPeer.doSelect(crite
     </p>
   </section>
 
-  <section name="Using DISTINCT with Criteria">
+  <section name="Using DISTINCT">
 
     <p>
       All of the examples in the section "joins" can return multiples
@@ -455,13 +478,13 @@ List authors = AuthorPeer.doSelect(crite
     
     <p>
       In the first example in the section 
-      &quot;Inner joins for qualifying&quot;, the author will appear 
+      &quot;Inner joins for qualifying&quot;, the author would appear 
       for every book that is attached to it. 
-      If an author has published 10 books, the author will appear
+      If an author has published 10 books, the author would appear
       in the returned List 10 times.
       To avoid this problem so that our returned List only returns one author
-      once despite the number of times it appears, we can use the setDistinct()
-      method in Criteria. For instance:
+      once despite the number of times it appears, we have used the
+      setDistinct() method in Criteria. For instance:
     </p>
 
 <source>
@@ -485,11 +508,11 @@ List bookAuthors = AuthorPeer.doSelect(c
    <p>
      One of the common clauses in an SQL Query is the ORDER BY clause.
      With the criteria object, the results can be ordered via the
-     addAscendingOrderByColumn(String columnname) and
-     addDescendingOrderByColumn(String columnname) methods.
+     addAscendingOrderByColumn(Column) and
+     addDescendingOrderByColumn(Column) methods.
      As an example, consider the book table from the tutorial. 
      To get all books ordered by their title and ISBN 
-     (where the ISBN should only be taken into accout for equal titles),
+     (where the ISBN should only be taken into account for equal titles),
      use the following code:
    </p>
 
@@ -511,8 +534,8 @@ List books = BookPeer.doSelect(criteria)
     
 <source>
 Criteria criteria = new Criteria();
-Criteria.add(AuthorPeer.LAST_NAME, "Stevens");
-Criteria.add(AuthorPeer.FIRST_NAME, "W.");
+Criteria.where(AuthorPeer.LAST_NAME, "Stevens");
+Criteria.where(AuthorPeer.FIRST_NAME, "W.");
 List authors = AuthorPeer.doSelect(criteria);
 </source>
       
@@ -525,10 +548,39 @@ SELECT ... from AUTHOR where LAST_NAME='
 </source>
 
     <p>
-      To exlicitly specify which operator should be used to link the constraints
+      To explicitly specify which operator should be used to link the constraints
       in a Criteria, use the methods 
-      <code>Criteria.Criterion.and()</code> and 
-      <code>Criteria.Criterion.or()</code>.
+      <code>Criteria.and()</code> and 
+      <code>Criteria.or()</code>.
+      The former and's a condition with all the other conditions already in the
+      criteria, and the latter or's a condition with all 
+      the other conditions already in the criteria (Note: this is different
+      for the deprecated util.Criteria).
+    </p>
+    <p>
+      For example, to produce the following SQL query:
+    </p>
+<source><![CDATA[
+select * from abc where (a < 1 and b > 2) or (a > 5)
+]]></source>
+
+    <p>
+      you can use the code
+    </p>
+    
+<source><![CDATA[
+Criteria crit = new Criteria()
+    .where(ABC.A, 1, Criteria.LESS_THAN)
+    .and(ABC.B, 2, Criteria.GREATER_THAN)
+    .or(ABC.A, 5, Criteria.GREATER_THAN);
+]]></source>
+
+    <p>
+      For more complex queries, use the 
+      <code>org.apache.torque.critzeria.Criterion</code> object, and the methods
+      <code>Criterion.and()</code> and 
+      <code>Criterion.or()</code>
+      to combine them.
     </p>
 
     <p>
@@ -545,12 +597,12 @@ select * from abc where (a < 1 and b > 2
 
 <source><![CDATA[
 Criteria crit = new Criteria();
-Criteria.Criterion a1 = crit.getNewCriterion(ABC.A, 1, Criteria.LESS_THAN);
-Criteria.Criterion b2 = crit.getNewCriterion(ABC.B, 2, Criteria.GREATER_THAN);
-Criteria.Criterion a5 = crit.getNewCriterion(ABC.A, 5, Criteria.GREATER_THAN);
-Criteria.Criterion b3 = crit.getNewCriterion(ABC.B, 3, Criteria.LESS_THAN);
+Criterion a1 = new Criterion(ABC.A, 1, Criteria.LESS_THAN);
+Criterion b2 = new Criterion(ABC.B, 2, Criteria.GREATER_THAN);
+Criterion a5 = new Criterion(ABC.A, 5, Criteria.GREATER_THAN);
+Criterion b3 = new Criterion(ABC.B, 3, Criteria.LESS_THAN);
 
-crit.add(a1.and(b2).or(a5.and(b3)));
+crit.where(a1.and(b2).or(a5.and(b3)));
 ]]></source>
 
     <p>
@@ -571,7 +623,7 @@ crit.add(a1.and(b2).or(a5.and(b3)));
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(InvoicePeer.TABLE_NAME, searchField,
+criteria.where(InvoicePeer.TABLE_NAME, searchField,
         (Object) ("%" + searchCriteria + "%"), Criteria.LIKE);
 criteria.getCriterion(InvoicePeer.TABLE_NAME, searchField).setIgnoreCase(true);
 
@@ -591,52 +643,61 @@ List invoices = InvoicePeer.doSelect(cri
     
   </section>
 
-  <section name="Using the CUSTOM modifier to use custom SQL">
+  <section name="Using custom SQL">
 
     <p>
       Although Criteria provide for the most common SQL queries, some queries
       can not be created using standard Criteria methods.
-      With the CUSTOM modifier, the specified SQL is directly used 
-      in the where clause.  For internal reasons, you must still specify
-      a column on which the query part is acting.
+      However, the Criteria object has the following methods which allow to add
+      custom SQL: <code>andVerbatimSql()</code>,
+      <code>orVerbatimSql()</code>, and <code>whereVerbatimSql()</code>.

     </p>
     <p>
       For demonstration purposes, let us construct a query which retrieves
-      the author with the AUTHOR_ID of 5 using the CUSTOM modifier: 
+      the author with the AUTHOR_ID of 5: 
     </p>
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.AUTHOR_ID, (Object)"AUTHOR_ID=5", Criteria.CUSTOM);
+criteria.whereVerbatimSql("AUTHOR_ID=?", new Object[] {5}, AuthorPeer.AUTHOR_ID, null);
 List authors = AuthorPeer.doSelect(criteria);
 </source>
 
     <p>
-      Note that in this specific example, there was no need for the CUSTOM
-      modifier. The same query could have been created by:
+      The first argument specifies the custom SQL, the second argument the
+      prepared statement replacements in the SQL, the third argument and the
+      fourth arguments can be used to specify columns accessed in the Custom SQL
+      (this is needed to calculate the FROM clause of the SQL). 
+      Note that in the specific example above, there was no need
+      for using custom SQL. The same query could have been created by:
     </p>
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.AUTHOR_ID, 5);
+criteria.where(AuthorPeer.AUTHOR_ID, 5);
 List authors = AuthorPeer.doSelect(criteria);
 </source>
 
     <p>
-      It is recommended <em>not</em> to use the CUSTOM modifier whenever
-      you can avoid it.  If you use the CUSTOM modifier,  your code will be
+      It is recommended <em>not</em> to use verbatim SQL whenever
+      you can avoid it.  If you use verbatim SQL,  your code will be
       less portable to other databases, and the compiler
       will not alert you if you change your data model and access a column 
       which no longer exists.
     </p>
     
+    <p>
+      The old way of specifying custom SQL using Criteria.CUSTOM still exists,
+      however this does not allow to use Prepared Statement replacements.
+    </p>
+    
   </section>
 
-  <!--section name="subselects">
+  <section name="Subselects in the WHERE clause">
     <p>
-      To use a subselect, simply put a criteria which represents the 
-      subselect at the place where you would normally specify the column
-      value(s) explicitly.
+      To use a subselect in the WHERE clause, simply put a criteria which
+      represents the subselect at the place where you would normally specify
+      the column value(s) explicitly.
     </p>
     
     <p>
@@ -652,14 +713,42 @@ List authors = AuthorPeer.doSelect(crite
     
 <source>
 Criteria subquery = new Criteria();
+subquery.addSelectColumn(new Max(AuthorPeer.AUTHOR_ID));
+
+Criteria criteria = new Criteria();
+criteria.where(AuthorPeer.AUTHOR_ID, subquery);
+
+List authors = AuthorPeer.doSelect(criteria);
+</source>
+  </section>
+
+  <section name="Subselects in the FROM clause">
+    <p>
+      There are two ways to create a subselect in the FROM clause.
+      The first way is to use the addFrom methods in the Criteria.
+      This is not recommended as you will have to specify the FROM clause 
+      manually, which will not be as portable as the second method and also
+      the compiler won't warn you if a column you use in the FROM clause
+      disappears from your model. Still, this method may be needed at times.
+    </p>
+    
+    <p>
+      The second way is by specifying an alias which contains the subselect.
+      This is the preferred way to add a subselect to the FROM clause.
+      For example, a very complicated way to retrieve all authors would be
+    </p>
+    
+<source>
+TODO
+Criteria subquery = new Criteria();
 subquery.addSelectColumn("MAX(" + AuthorPeer.AUTHOR_ID + ")");
 
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.AUTHOR_ID, subquery);
+criteria.where(AuthorPeer.AUTHOR_ID, subquery);
 
 List authors = AuthorPeer.doSelect(criteria);
 </source>
-  </section-->
+  </section>
 
   <section name="Using Criterion to use a Column twice in a Criteria">
 
@@ -683,7 +772,7 @@ List authors = AuthorPeer.doSelect(crite
 
 <source>
 Criteria criteria = new Criteria();
-criteria.add(AuthorPeer.AUTHOR_ID, 5, Criteria.GREATER_EQUAL);
+criteria.where(AuthorPeer.AUTHOR_ID, 5, Criteria.GREATER_EQUAL);
 
 Criteria.Criterion criterion = criteria.getCriterion(AuthorPeer.AUTHOR_ID);
 criterion.and(
@@ -744,7 +833,7 @@ criterion.and(
 public static List doSelectByLastName(String lastName)
 {
     Criteria criteria = new Criteria();
-    criteria.add(AuthorPeer.LAST_NAME, lastName);
+    criteria.where(AuthorPeer.LAST_NAME, lastName);
     List result = AuthorPeer.doSelect(criteria);
     return result;
 }
@@ -801,11 +890,11 @@ public class AuthorFilter
         Criteria result = new Criteria();
         if (firstName != null)
         {
-            result.add(AuthorPeer.FIRST_NAME, firstName);
+            result.where(AuthorPeer.FIRST_NAME, firstName);
         }
         if (lastName != null)
         {
-            result.add(AuthorPeer.LAST_NAME, lastName);
+            result.where(AuthorPeer.LAST_NAME, lastName);
         }
         return criteria;
     }
@@ -860,7 +949,7 @@ public class SimpleCriteria extends Crit
      */
     public SimpleCriteria greaterThan(String columnname, int columnvalue)
     {
-        super.add(columnname, columnvalue, Criteria.GREATER_THAN);
+        super.where(columnname, columnvalue, Criteria.GREATER_THAN);
         return this;
     }
 
@@ -872,7 +961,7 @@ public class SimpleCriteria extends Crit
      */
     public SimpleCriteria isBetween(String columnname, int min, int max)
     {
-        super.add(columnname, min, Criteria.GREATER_THAN);
+        super.where(columnname, min, Criteria.GREATER_THAN);
         super.Criterion criterion = criteria.getCriterion(columnname);
         criterion.and(
                    super.getNewCriterion(



---------------------------------------------------------------------
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