Author: tfischer
Date: Wed Sep 24 00:51:27 2014
New Revision: 1627185

URL: http://svn.apache.org/r1627185
Log:
TORQUE-328 Use builder pattern throughout criteria

Modified:
    
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java

Modified: 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java?rev=1627185&r1=1627184&r2=1627185&view=diff
==============================================================================
--- 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
 (original)
+++ 
db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/criteria/Criteria.java
 Wed Sep 24 00:51:27 2014
@@ -460,13 +460,16 @@ public class Criteria implements Seriali
      *
      * @param dbName The Database(Map) name.
      *
+     * @return A modified Criteria object.
+     *
      * @throws TorqueRuntimeException if this operation is performed on a
      *         Criteria composed of set parts (e.g. union, intersect, except).
      */
-    public void setDbName(final String dbName)
+    public Criteria setDbName(final String dbName)
     {
         assertNoComposite();
         this.dbName = dbName;
+        return this;
     }
 
     /**
@@ -736,11 +739,14 @@ public class Criteria implements Seriali
      *
      * @throws TorqueRuntimeException if this operation is performed on a
      *         Criteria composed of set parts (e.g. union, intersect, except).
+     *
+     * @return A modified Criteria object.
      */
-    public void setAll()
+    public Criteria setAll()
     {
         assertNoComposite();
         selectModifiers.add(ALL.toString());
+        return this;
     }
 
     /**
@@ -748,11 +754,14 @@ public class Criteria implements Seriali
      *
      * @throws TorqueRuntimeException if this operation is performed on a
      *         Criteria composed of set parts (e.g. union, intersect, except).
+     *
+     * @return A modified Criteria object.
      */
-    public void setDistinct()
+    public Criteria setDistinct()
     {
         assertNoComposite();
         selectModifiers.add(DISTINCT.toString());
+        return this;
     }
 
     /**
@@ -880,10 +889,13 @@ public class Criteria implements Seriali
      * Sets the JDBC statement fetch size to use for queries.
      *
      * @param fetchSize the fetch size, or null for not set.
+     *
+     * @return A modified Criteria object.
      */
-    public void setFetchSize(final Integer fetchSize)
+    public Criteria setFetchSize(final Integer fetchSize)
     {
         this.fetchSize = fetchSize;
+        return this;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to