db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r999072 - in /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque: ./ adapter/ avalon/ util/ util/functions/
Date Mon, 20 Sep 2010 19:25:44 GMT
Author: tfischer
Date: Mon Sep 20 19:25:43 2010
New Revision: 999072

URL: http://svn.apache.org/viewvc?rev=999072&view=rev
Log:
Removed trailing spaces

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueRuntimeException.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/TorqueComponent.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/Aggregate.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionEnum.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionFactory.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/SQLFunction.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java Mon Sep 20 19:25:43 2010
@@ -266,7 +266,7 @@ public class Torque
      * Register a MapBuilder
      *
      * @param builder the instance of the MapBuilder
-     * 
+     *
      */
     public static void registerMapBuilder(MapBuilder builder)
     {
@@ -279,14 +279,14 @@ public class Torque
      * @param className of the MapBuilder
      * @return A MapBuilder, not null
      * @throws TorqueException if the Map Builder cannot be instantiated
-     * 
+     *
      */
     public static MapBuilder getMapBuilder(String className)
         throws TorqueException
     {
         return getInstance().getMapBuilder(className);
     }
-    
+
     /**
      * This method returns a Connection from the default pool.
      *

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueInstance.java Mon Sep 20 19:25:43 2010
@@ -160,25 +160,25 @@ public class TorqueInstance
 
         isInit = true;
 
-        // re-build any MapBuilders that may have gone lost during serialization 
+        // re-build any MapBuilders that may have gone lost during serialization
         synchronized (mapBuilderCache)
         {
             for (Iterator i = mapBuilderCache.entrySet().iterator(); i.hasNext();)
             {
                 Map.Entry entry = (Map.Entry)i.next();
-                
+
                 if (null == entry.getValue())
                 {
                     try
                     {
                         // create and build the MapBuilder
                         MapBuilder builder = (MapBuilder) Class.forName((String) entry.getKey()).newInstance();
-        
+
                         if (!builder.isBuilt())
                         {
                             builder.doBuild();
                         }
-    
+
                         entry.setValue(builder);
                     }
                     catch (Exception e)
@@ -439,7 +439,7 @@ public class TorqueInstance
                         defaultDatabase.getDataSourceFactory());
                 databaseInfoForKeyDefault.setAdapter(
                         defaultDatabase.getAdapter());
-                
+
                 this.defaultDsfIsReference = true;
             }
         }
@@ -689,14 +689,14 @@ public class TorqueInstance
                 }
             }
         }
-        
+
         // shut down the cache managers
         synchronized (managers)
         {
             for (Iterator it = managers.entrySet().iterator(); it.hasNext();)
             {
                 Map.Entry mentry = (Map.Entry)it.next();
-                
+
                 AbstractBaseManager manager = (AbstractBaseManager)mentry.getValue();
                 manager.dispose();
                 it.remove();
@@ -802,7 +802,7 @@ public class TorqueInstance
      * Get the registered MapBuilders
      *
      * @return the MapBuilder cache
-     * 
+     *
      */
     public Map getMapBuilders()
     {
@@ -823,20 +823,20 @@ public class TorqueInstance
      * Register a MapBuilder
      *
      * @param builder the instance of the MapBuilder
-     * 
+     *
      */
     public void registerMapBuilder(MapBuilder builder)
     {
         mapBuilderCache.put(builder.getClass().getName(), builder);
     }
-    
+
     /**
      * Get a MapBuilder
      *
      * @param className of the MapBuilder
      * @return A MapBuilder, not null
      * @throws TorqueException if the Map Builder cannot be instantiated
-     * 
+     *
      */
     public MapBuilder getMapBuilder(String className)
         throws TorqueException
@@ -877,7 +877,7 @@ public class TorqueInstance
             throw new TorqueException(e);
         }
     }
-    
+
     /**
      * This method returns a Connection from the default pool.
      *

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueRuntimeException.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueRuntimeException.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueRuntimeException.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/TorqueRuntimeException.java Mon Sep 20 19:25:43 2010
@@ -222,6 +222,6 @@ public class TorqueRuntimeException
         {
             list.add(st.nextToken());
         }
-        return (String[]) list.toArray(new String[list.size()]); 
+        return (String[]) list.toArray(new String[list.size()]);
     }
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java Mon Sep 20 19:25:43 2010
@@ -65,16 +65,16 @@ import org.apache.torque.util.functions.
  */
 public abstract class AbstractDBAdapter implements DB
 {
-    /** 
+    /**
      * The default look up table for function classes.
      */
     private Map functionClasses = new Hashtable(10);
     /*
      * Initialize the functionClasses lookup table with SQL99 standard
-     * functions. Uses this method because DB implementations don't 
+     * functions. Uses this method because DB implementations don't
      * currently call super() in their constructors and we want this
      * to be set in all of them.
-     * 
+     *
      * Override the values set here in the DB Specific adaptor's
      * constructor.
      */
@@ -85,7 +85,7 @@ public abstract class AbstractDBAdapter 
         functionClasses.put( FunctionEnum.MIN, Aggregate.Min.class );
         functionClasses.put( FunctionEnum.SUM, Aggregate.Sum.class );
     }
-    
+
     /**
      * Empty constructor.
      */
@@ -308,13 +308,13 @@ public abstract class AbstractDBAdapter 
     /**
      * Return the class which implements the SQLFunction interface for the
      * specified function.
-     * 
+     *
      * @param function The function to get the class for.
      * @return The SQLFunction implementation for a function of this type that
      *         will work with this type of DB. Null indicates a class was not
-     *         found. 
+     *         found.
      */
-    public Class getFunctionClass( FunctionEnum function ) 
+    public Class getFunctionClass( FunctionEnum function )
     {
         return (Class) functionClasses.get( function );
     }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java Mon Sep 20 19:25:43 2010
@@ -270,16 +270,16 @@ public interface DB extends Serializable
      * @return whether the escape clause should be appended or not.
      */
     boolean useEscapeClauseForLike();
-    
+
     /**
      * Return the class which implements the SQLFunction interface for the
-     * specified function. This class must have an empty constructor and 
-     * can be a single level inner class (or not). 
-     * 
+     * specified function. This class must have an empty constructor and
+     * can be a single level inner class (or not).
+     *
      * @param function The function to get the class for.
      * @return The SQLFunction implementation for a function of this type that
      *         will work with this type of DB. Null indicates a class was not
-     *         found. 
+     *         found.
      * @see SQLFunction
      * @see AbstractFunction
      * @see Aggregate

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/Torque.java Mon Sep 20 19:25:43 2010
@@ -117,21 +117,21 @@ public interface Torque
      * Register a MapBuilder
      *
      * @param builder the instance of the MapBuilder
-     * 
+     *
      */
     void registerMapBuilder(MapBuilder builder);
-    
+
     /**
      * Get a MapBuilder
      *
      * @param className of the MapBuilder
      * @return A MapBuilder, not null
      * @throws TorqueException if the Map Builder cannot be instantiated
-     * 
+     *
      */
     MapBuilder getMapBuilder(String className)
         throws TorqueException;
-    
+
     /**
      * This method returns a Connection from the default pool.
      *

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/TorqueComponent.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/TorqueComponent.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/TorqueComponent.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/avalon/TorqueComponent.java Mon Sep 20 19:25:43 2010
@@ -161,13 +161,13 @@ public class TorqueComponent
             throws Exception
     {
         getLogger().debug("initialize()");
-        
+
         TorqueInstance instance = org.apache.torque.Torque.getInstance();
-        
+
         Map mapBuilders = instance.getMapBuilders();
-        
+
         if (mapBuilders != null)
-        {    
+        {
             // Copy the registered MapBuilders and take care that they will be built again
             for (Iterator  i = mapBuilders.keySet().iterator(); i.hasNext();)
             {
@@ -175,7 +175,7 @@ public class TorqueComponent
                 registerMapBuilder(className);
             }
         }
-        
+
         // Provide the singleton instance to the static accessor
         org.apache.torque.Torque.setInstance(this);
 

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java Mon Sep 20 19:25:43 2010
@@ -3095,7 +3095,7 @@ public class Criteria extends Hashtable
 
         // Joins need to be deserialized manually.
         this.joins = new ArrayList(3);
-        
+
         ArrayList joins = (ArrayList) s.readObject();
         if (joins != null)
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java Mon Sep 20 19:25:43 2010
@@ -741,14 +741,14 @@ public class LargeSelect implements Runn
                 }
             }
 
-            /* 
+            /*
              * Fix criterions relating to booleanint or booleanchar columns
              * The defaultTableMap parameter in this call is null because we have
              * no default peer class inside LargeSelect. This means that all
              * columns not fully qualified will not be modified.
              */
             BasePeer.correctBooleans(criteria, null);
-            
+
             query = BasePeer.createQueryString(criteria);
 
             // Get a connection to the db.

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java Mon Sep 20 19:25:43 2010
@@ -215,7 +215,7 @@ public class Query
     }
 
     /**
-     * Set the offset number.  This is used to set the row where the 
+     * Set the offset number.  This is used to set the row where the
      * resultset starts.
      *
      * @param offset A String.
@@ -281,7 +281,7 @@ public class Query
     }
 
     /**
-     * Get the offset number.  This is used to set the row where the 
+     * Get the offset number.  This is used to set the row where the
      * resultset starts.
      *
      * @return A String with the offset, or null if no offset is set.

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java Mon Sep 20 19:25:43 2010
@@ -42,13 +42,13 @@ import com.workingdogs.village.Value;
  * <p>A utility to help produce aggregate summary information about a table.
  * The default assumes that the underlying DB supports the SQL 99 Standard
  * Aggregate functions, e.g. COUNT, SUM, AVG, MAX, & MIN.  However, some
- * non-standard functions (like MySQL's older LEAST instead of MIN can be 
+ * non-standard functions (like MySQL's older LEAST instead of MIN can be
  * handled programatically if needed (@see Aggregate class)</p>
- *   
+ *
  * <P>Here is a simple example to generate the results of a query like:</P>
- * 
+ *
  * <pre>
- * SELECT EMPLOYEE, SUM(HOURS), MIN(HOURS), MAX(HOURS) 
+ * SELECT EMPLOYEE, SUM(HOURS), MIN(HOURS), MAX(HOURS)
  *     FROM TIMESHEET WHERE TYPE = 1 GROUP BY EMPLOYEE ORDER BY EMPLOYEE ASC
  * </pre>
  * <p>Use the following code</p>
@@ -80,7 +80,7 @@ import com.workingdogs.village.Value;
  * method or by the first table prefix in an aggregate function.</p>
  * <p>
  * This will also work with joined tables if the criteria is creates as
- * to create valid SQL.</p> 
+ * to create valid SQL.</p>
  *
  * @see org.apache.torque.util.functions.FunctionFactory
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
@@ -89,7 +89,7 @@ import com.workingdogs.village.Value;
 public class SummaryHelper
 {
     static Log logger = LogFactory.getLog(SummaryHelper.class);
-    
+
     /** A list of the group by columns names (e.g. TABLE.COLUMN) */
     private List groupByColumns;
     /** A OrderMap<String,Aggregate.Function> with the aggregate functions
@@ -97,31 +97,31 @@ public class SummaryHelper
     private OrderedMap aggregates;
     /** Flag for excluding unnamed columns. */
     private boolean excludeExprColumns = false;
-    
+
     /**
      * Simple constructor
      */
-    public SummaryHelper() 
+    public SummaryHelper()
     {
         super();
     }
-    
+
     /**
      * Return a list of OrderedMap objects with the results of the summary
      * query.  The OrderedMap objects have a key of the column name or
      * function alias and are in the order generated by the query.
-     * 
+     *
      * @param crit The base criteria to build on.
-     * @return Results as a OrderMap<String,Values> object.  
+     * @return Results as a OrderMap<String,Values> object.
      * @throws TorqueException
      * @throws DataSetException
      */
-    public List summarize( Criteria crit ) 
-                                throws TorqueException, DataSetException 
+    public List summarize( Criteria crit )
+                                throws TorqueException, DataSetException
     {
         return summarize( crit, null );
     }
-    
+
     /**
      * Return a list of OrderedMap objects with the results of the summary
      * query.  The OrderedMap objects have a key of the column name or
@@ -129,15 +129,15 @@ public class SummaryHelper
      *
      * @param crit The base criteria to build on.
      * @param conn The DB Connection to use.
-     * @return Results as a OrderMap<String,Values> object. 
+     * @return Results as a OrderMap<String,Values> object.
      * @throws TorqueException
      * @throws DataSetException
      */
-    public List summarize( Criteria crit, Connection conn ) 
-                                 throws TorqueException, DataSetException 
+    public List summarize( Criteria crit, Connection conn )
+                                 throws TorqueException, DataSetException
     {
         Criteria c = buildCriteria( crit );
-         
+
         List results;
         if (conn == null)
         {
@@ -149,19 +149,19 @@ public class SummaryHelper
         }
 
         Iterator r = results.iterator();
-        
+
         Vector resultsList = new Vector(results.size());
-        while ( r.hasNext() ) 
+        while ( r.hasNext() )
         {
             ListOrderedMap recordMap = new ListOrderedMap();
             Record rec = (Record) r.next();
             String cName = null;
             Value value = null;
-            for ( int i = 1; i <= rec.size(); i++ ) 
+            for ( int i = 1; i <= rec.size(); i++ )
             {
                 value = rec.getValue(i);
                 cName = rec.schema().column(i).name();
-                if ( cName == null || cName.equals("") ) 
+                if ( cName == null || cName.equals("") )
                  {
                     if ( excludeExprColumns() ) {
                         continue;
@@ -172,22 +172,22 @@ public class SummaryHelper
             }
             resultsList.add(recordMap);
         }
-        return resultsList;  
+        return resultsList;
     }
-    
+
     /**
      * Builds the criteria to use in summarizing the information.  Note that
      * the criteria passed in will be modified.
-     * 
+     *
      * @param c The base criteria to build the summary criteria from.
      * @return A criteria to use in summarizing the information.
      * @throws TorqueException
      */
     public Criteria buildCriteria( Criteria c ) throws TorqueException {
-        
+
         c.getSelectColumns().clear();
         c.getGroupByColumns().clear();
-        
+
         UniqueList criteriaSelectModifiers;
         criteriaSelectModifiers = c.getSelectModifiers();
 
@@ -201,29 +201,29 @@ public class SummaryHelper
 
         List cols = null;
         Iterator i = null;
-        
+
         cols = getGroupByColumns();
         i = cols.iterator();
         boolean haveFromTable = i.hasNext(); // Group By cols define src table.
-        while ( i.hasNext() ) 
+        while ( i.hasNext() )
         {
             String col = (String) i.next();
             c.addGroupByColumn( col );
             c.addSelectColumn(col);
         }
-        if ( haveFromTable ) 
+        if ( haveFromTable )
             logger.debug("From table defined by Group By Cols");
-        
+
         // Check if the from table is set via a where clause.
-        if ( ! haveFromTable && c.keys().hasMoreElements() ) 
+        if ( ! haveFromTable && c.keys().hasMoreElements() )
         {
             haveFromTable = true;
             logger.debug("From table defined by a where clause");
         }
-        
+
         OrderedMap cMap = getAggregates();
         OrderedMapIterator iMap = cMap.orderedMapIterator();
-        while ( iMap.hasNext() ) 
+        while ( iMap.hasNext() )
         {
             String key = (String) iMap.next();
             SQLFunction f = (SQLFunction) iMap.getValue();
@@ -231,20 +231,20 @@ public class SummaryHelper
             if ( ! haveFromTable )    // Last chance. Get it from the func.
             {
                 String col =  f.getArgument(0).toString();
-                if ( col.indexOf('.') >= 0) 
+                if ( col.indexOf('.') >= 0)
                 {
                     // Kludgy Where table.col = table.col clause to force
                     // from table identification.
-                    c.add( col,(Object)(col + "=" + col), SqlEnum.CUSTOM );  
+                    c.add( col,(Object)(col + "=" + col), SqlEnum.CUSTOM );
                     haveFromTable = true;
 
                     String table = col.substring(0,col.indexOf('.'));
-                    logger.debug("From table, '" + table + 
+                    logger.debug("From table, '" + table +
                                  "', defined from aggregate column");
                 }
             }
         }
-        if ( ! haveFromTable ) 
+        if ( ! haveFromTable )
         {
             throw new TorqueException(
                          "No FROM table defined by the GroupBy set, " +
@@ -255,49 +255,49 @@ public class SummaryHelper
 
     /**
      * <p>
-     * Add a column that will be used to group the aggregate results by. 
+     * Add a column that will be used to group the aggregate results by.
      * This is a first added / first listed on SQL method.  E.g.,
      * </p>
-     * <pre> 
-     *    add(TablePeer.COL1); 
+     * <pre>
+     *    add(TablePeer.COL1);
      *    add(TablePeer.COL2);
      * </pre>
-     *     
+     *
      * <p>Generates SQL like:  SELECT .... GROUP BY Table.COL1, TABLE.COL2</p>
-     * 
+     *
      * @param column
      */
-    public void addGroupBy( String column ) 
+    public void addGroupBy( String column )
     {
         getGroupByColumns().add(column);
     }
-      
+
     /**
-     * Add in an Aggregate function to the summary information.  
-     * 
-     * @param alias  A valid SQL99 column identifier ([_A-Z0-9] no spaces and 
+     * Add in an Aggregate function to the summary information.
+     *
+     * @param alias  A valid SQL99 column identifier ([_A-Z0-9] no spaces and
      *               no key words, e.g. function names.
-     * @param function One of the inner classes from the Aggregate class. 
+     * @param function One of the inner classes from the Aggregate class.
      */
-    public void addAggregate( String alias, SQLFunction function ) 
+    public void addAggregate( String alias, SQLFunction function )
     {
         getAggregates().put( alias, function );
     }
-    
+
     /**
      *  Resets the class internal variables to their initial states so
-     *  the class can be re-used like a new class. 
+     *  the class can be re-used like a new class.
      */
-    public void clear() 
+    public void clear()
     {
         getGroupByColumns().clear();
         getAggregates().clear();
         setExcludeExprColumns(false);
     }
 
-    public List getGroupByColumns() 
+    public List getGroupByColumns()
     {
-        if ( groupByColumns == null ) 
+        if ( groupByColumns == null )
         {
             groupByColumns = new Vector();
         }
@@ -308,66 +308,66 @@ public class SummaryHelper
      * Get the order map list of aggregate functions to use in
      * summarizing this table's informations.  The key is used
      * as the result column alias.
-     * 
+     *
      * @return the avgColumns.  Will always return a ListOrderedMap object.
      */
     public OrderedMap getAggregates()
     {
-        if ( aggregates == null ) 
+        if ( aggregates == null )
         {
             aggregates = new ListOrderedMap();
         }
         return aggregates;
     }
-    
+
     /**
-     * Convenience method to dump a summary results list to an output writer 
-     * in a semi-CSV format. E.g., there is no handling of embedded 
+     * Convenience method to dump a summary results list to an output writer
+     * in a semi-CSV format. E.g., there is no handling of embedded
      * quotes/special characters.
-     * 
+     *
      * @param out
      * @param results
      * @param includeHeader
      * @throws IOException
      */
-    public void dumpResults(Writer out, List results, boolean includeHeader ) 
-                                                            throws IOException 
+    public void dumpResults(Writer out, List results, boolean includeHeader )
+                                                            throws IOException
     {
         Iterator i = results.iterator();
         boolean first = includeHeader;
-        
-        while ( i.hasNext() ) 
+
+        while ( i.hasNext() )
         {
             OrderedMap rec = (OrderedMap ) i.next();
             OrderedMapIterator rI = rec.orderedMapIterator();
             String heading = "";
             String recString = "";
-            while ( rI.hasNext() ) 
+            while ( rI.hasNext() )
             {
                 String colId = (String) rI.next();
-                if ( first ) 
+                if ( first )
                 {
                     heading += "\"" + colId + "\"";
-                    if ( rI.hasNext() ) 
+                    if ( rI.hasNext() )
                     {
                         heading += ", ";
                     }
                 }
                 Value v = (Value) rI.getValue();
-                if ( v.isString() ) 
+                if ( v.isString() )
                 {
                     recString += "\"" + v.toString() + "\"";
-                } 
-                else 
+                }
+                else
                 {
                     recString += v.toString();
                 }
-                if ( rI.hasNext() ) 
+                if ( rI.hasNext() )
                 {
                     recString += ", ";
                 }
             }
-            if ( first ) 
+            if ( first )
             {
                 first = false;
                 out.write(heading);
@@ -379,8 +379,8 @@ public class SummaryHelper
     }
 
     /**
-     * Should the results include unnamed columns, e.g. EXPR{index#}. 
-     * 
+     * Should the results include unnamed columns, e.g. EXPR{index#}.
+     *
      * @return the excludeExprColumns
      */
     public boolean excludeExprColumns()
@@ -389,18 +389,18 @@ public class SummaryHelper
     }
 
     /**
-     * <p>Define if unnamed output columns which get labeled as EXPR{index#}) 
+     * <p>Define if unnamed output columns which get labeled as EXPR{index#})
      * should be included in the the output set.</p>
-     * <p>  
-     * Note these are generally added by the criteria 
+     * <p>
+     * Note these are generally added by the criteria
      * processing to handle special cases such as case insensitive ordering.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param excludeExprColumns if True, these columns won't be included.
      */
     public void setExcludeExprColumns(boolean excludeExprColumns)
     {
         this.excludeExprColumns = excludeExprColumns;
     }
-    
+
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/AbstractFunction.java Mon Sep 20 19:25:43 2010
@@ -25,9 +25,9 @@ import java.util.Vector;
 import org.apache.torque.Torque;
 
 /**
- * A default framework that implements the core SQLFunction interface 
- * requirements that can be used to build specific functions on. 
- * 
+ * A default framework that implements the core SQLFunction interface
+ * requirements that can be used to build specific functions on.
+ *
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id
  */
@@ -37,7 +37,7 @@ public abstract class AbstractFunction i
     private List argumentList;
     /** The Torque DB connector name this function is associated with */
     private String dbName;
-    
+
     /**
      * Functions should only be created via the FunctionFactory class.
      */
@@ -49,7 +49,7 @@ public abstract class AbstractFunction i
      * This should return the SQL string that can be used
      * when constructing the query.  E.g. "AVG( table.column )" or
      * CONCAT(table.column, " foobar");
-     *  
+     *
      * @return The SQL String.
      */
     public abstract String toSQL();
@@ -57,26 +57,26 @@ public abstract class AbstractFunction i
     /**
      * Return a string representation of the function parameter
      * at the specified index.  Should be null if parameter does not exist.
-     * 
+     *
      * @param index The 0 based index of the parameter to get.
      * @return A String representation of the parameter.  Null if one does not
      *         exist.
      */
     public abstract String getArgument( int i );
-    
+
     /**
-     * Return all the parameters as an object array. This allow for 
+     * Return all the parameters as an object array. This allow for
      * processing of the parameters in their original format rather
      * than just in String format.  E.g. a parameter might be specified
      * as a Date object, or a Column object.
-     * 
-     * @return Should return a valid Object array and not null.  E.g. 
+     *
+     * @return Should return a valid Object array and not null.  E.g.
      *  implementors should return new Object[0] if there are no parameters.
      */
     public Object[] getArguments()
     {
         Object[] args = getArgumentList().toArray();
-        if ( args == null ) 
+        if ( args == null )
         {
             args = new Object[0];
         }
@@ -85,7 +85,7 @@ public abstract class AbstractFunction i
 
     /**
      * Get the name of the Torque Database associated with this function.
-     * 
+     *
      * @return The DB name.  Should not be null (use default DB in this case).
      * @exception IllegalStateException If Torque has not been initialized and
      *   the default DB name can not be determined.
@@ -93,7 +93,7 @@ public abstract class AbstractFunction i
     public String getDBName() throws IllegalStateException
     {
         if ( this.dbName == null ) {
-            this.dbName = Torque.getDefaultDB(); 
+            this.dbName = Torque.getDefaultDB();
         }
         if ( this.dbName == null ) {
             throw new IllegalStateException(
@@ -105,7 +105,7 @@ public abstract class AbstractFunction i
     /**
      * Return the object representation of the function parameter
      * at the specified index.  Will be null if parameter does not exist.
-     * 
+     *
      * @param index The 0 based index of the parameter to get.
      * @return The parameter object.  Null if one does not
      *         exist.
@@ -113,7 +113,7 @@ public abstract class AbstractFunction i
     protected Object getArgumentObject( int index )
     {
         List argList = getArgumentList();
-        if ( index >= argList.size() ) 
+        if ( index >= argList.size() )
         {
             return null;
         }
@@ -122,7 +122,7 @@ public abstract class AbstractFunction i
 
     /**
      * Add an argument to the function argument list
-     * 
+     *
      * @param arg The argument object.
      */
     protected void addArgument( Object arg ) {
@@ -131,16 +131,16 @@ public abstract class AbstractFunction i
 
     /**
      * Set the full function argument list.
-     * 
-     * @param args The new argument list 
+     *
+     * @param args The new argument list
      */
     protected void setArgumentList( List args ) {
         this.argumentList = args;
     }
-    
+
     /**
      * Get the full list of function arguments
-     * 
+     *
      * @return The argument list
      */
     protected List getArgumentList( ) {
@@ -149,7 +149,7 @@ public abstract class AbstractFunction i
         }
         return this.argumentList;
     }
-    
+
     /**
      * @param dbName the dbName to set
      */

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/Aggregate.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/Aggregate.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/Aggregate.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/Aggregate.java Mon Sep 20 19:25:43 2010
@@ -22,18 +22,18 @@ package org.apache.torque.util.functions
 import org.apache.torque.adapter.DB;
 
 /**
- * <p>A container for classes that will generate SQL for the SQL99 Standard 
+ * <p>A container for classes that will generate SQL for the SQL99 Standard
  * Aggregate functions. These can be used via the Criteria.addAsColumn
- * method to produce SQL statements that can be called via the 
- * BasePeer.doSelect methods.</p>  
+ * method to produce SQL statements that can be called via the
+ * BasePeer.doSelect methods.</p>
  * <p>
- * Note database servers that use non-standard function names  
+ * Note database servers that use non-standard function names
  * can be supported by using the setFunction(String) method.</p>
  * <p>
- * E.g., older MySQL servers use LEAST instead of MIN. This can be 
+ * E.g., older MySQL servers use LEAST instead of MIN. This can be
  * supported by creating a Aggregate.Min instance and then calling
  * the setFunction("LEAST") method.</p>
- * 
+ *
  * @see org.apache.torque.util.SummaryHelper
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id
@@ -44,8 +44,8 @@ public class Aggregate
     /**
      * The base class for all the standard aggregate function classes.
      */
-    public abstract class AgregateFunction 
-                        extends AbstractFunction 
+    public abstract class AgregateFunction
+                        extends AbstractFunction
                         implements SQLFunction
     {
         /** Should the column have DISTINCT added before it */
@@ -54,46 +54,46 @@ public class Aggregate
         private String function;
         /** Flag to determine if arguments have been set */
         private boolean argumentsSet = false;
-        
+
         /**
          * Base constructor for aggregate functions which must be created
-         * via the FunctionFactory / DB classes.<p>  
-         * 
+         * via the FunctionFactory / DB classes.<p>
+         *
          * @see FunctionFactory
          * @see DB
          */
-        protected AgregateFunction ( ) 
+        protected AgregateFunction ( )
         {
             super();
         }
-        
+
        /**
         * Assumes that there are one or two arguments being specified.  The
-        * first being a column identifier. (TODO: handle expressions) 
-        * and the second being an optional boolean indicating if DISTINCT 
+        * first being a column identifier. (TODO: handle expressions)
+        * and the second being an optional boolean indicating if DISTINCT
         * needs to be added.
-        * 
+        *
         * @param args The column to apply the function to.
-        * @throws IllegalArgumentException If at least one argument has not 
-        *                              been supplied or the second argument 
+        * @throws IllegalArgumentException If at least one argument has not
+        *                              been supplied or the second argument
         *                              object is not Boolean.
-        */                              
+        */
         public void setArguments( Object[] args )
                                             throws IllegalArgumentException
         {
 
-            if ( args.length < 1 ) 
+            if ( args.length < 1 )
             {
                 throw new IllegalArgumentException(
                       "There must be at least one argument object specified!");
             }
-            if ( args.length < 2 ) 
+            if ( args.length < 2 )
             {
                 this.distinct = false;
-            } 
-            else 
+            }
+            else
             {
-                if ( ! ( args[1] instanceof Boolean ) ) 
+                if ( ! ( args[1] instanceof Boolean ) )
                 {
                     throw new IllegalArgumentException(
                            "Second argument object is not type Boolean!");
@@ -103,51 +103,51 @@ public class Aggregate
             addArgument( args[0].toString() );
             this.argumentsSet = true;
         }
-        
+
         /**
          * Should the column have DISTINCT added in front of it?
-         * 
+         *
          * @return True if DISTINCT is needed.
          */
-        public boolean isDistinct() 
+        public boolean isDistinct()
         {
             return this.distinct;
         }
-        
+
         /**
          * Get the function name to use, e.g. AVG, MIN, LEAST.
-         * 
+         *
          * @return The function.
          */
-        protected String getFunction() 
+        protected String getFunction()
         {
             return this.function;
         }
-        
+
         /**
          * Set the function to use.
-         *  
+         *
          * @param value The function to use.
          */
-        public void setFunction( String value ) 
+        public void setFunction( String value )
         {
             this.function = value;
         }
-        
+
         /**
          * Generate the SQL for this function.
          */
-        public String toSQL() 
+        public String toSQL()
                     throws IllegalStateException
         {
-            if ( ! argumentsSet ) 
+            if ( ! argumentsSet )
             {
-                throw new IllegalStateException ( 
+                throw new IllegalStateException (
                                "Function arguments have not been set!");
             }
             StringBuffer sb = new StringBuffer();
             sb.append(getFunction()).append("(");
-            if ( isDistinct() ) 
+            if ( isDistinct() )
             {
                 sb.append("DISTINCT ");
             }
@@ -162,7 +162,7 @@ public class Aggregate
         {
             return (String) getArgumentObject(index);
         }
-        
+
     }
 
     /**
@@ -172,11 +172,11 @@ public class Aggregate
     {
         /**
          * Construct an AVG function class.
-         * 
+         *
          * @see Aggregate.AgregateFunction
          * @see FunctionFactory
          */
-        protected Avg() 
+        protected Avg()
         {
             super();
             setFunction("AVG");
@@ -186,15 +186,15 @@ public class Aggregate
     /**
      * SQL99 Standard Count records function.
      */
-    public class Count extends Aggregate.AgregateFunction 
+    public class Count extends Aggregate.AgregateFunction
     {
         /**
          * Construct a COUNT function class.
-         * 
+         *
          * @see Aggregate.AgregateFunction
          * @see FunctionFactory
          */
-        protected Count() 
+        protected Count()
         {
             super();
             setFunction("COUNT");
@@ -204,15 +204,15 @@ public class Aggregate
     /**
      * SQL99 Standard Minimum value of column function.
      */
-    public class Min extends Aggregate.AgregateFunction 
+    public class Min extends Aggregate.AgregateFunction
     {
         /**
          * Construct a MIN function class.
-         * 
+         *
          * @see Aggregate.AgregateFunction
          * @see FunctionFactory
          */
-        protected Min() 
+        protected Min()
         {
             super();
             setFunction("MIN");
@@ -222,15 +222,15 @@ public class Aggregate
     /**
      * SQL99 Standard maximum value of column function.
      */
-    public class Max extends Aggregate.AgregateFunction 
+    public class Max extends Aggregate.AgregateFunction
     {
         /**
          * Construct a MAX function class.
-         * 
+         *
          * @see FunctionFactory
          * @see Aggregate.AgregateFunction
          */
-        protected Max( ) 
+        protected Max( )
         {
             super();
             setFunction("MAX");
@@ -240,15 +240,15 @@ public class Aggregate
     /**
      * SQL99 Standard sum column values function.
      */
-    public class Sum extends Aggregate.AgregateFunction 
+    public class Sum extends Aggregate.AgregateFunction
     {
         /**
          * Construct a SUM function class.
-         * 
+         *
          * @see FunctionFactory
          * @see Aggregate.AgregateFunction
          */
-        protected Sum( ) 
+        protected Sum( )
         {
             super();
             setFunction("SUM");

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionEnum.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionEnum.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionEnum.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionEnum.java Mon Sep 20 19:25:43 2010
@@ -20,9 +20,9 @@ package org.apache.torque.util.functions
  */
 
 /**
- * A typesafe enum of SQL Standard function names.  Used by the 
+ * A typesafe enum of SQL Standard function names.  Used by the
  * FunctionFactory and (eventually) the DB Adaptors to create SQLFunction
- * objects. 
+ * objects.
  *
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id
@@ -56,7 +56,7 @@ public class FunctionEnum implements jav
      * This is a static only class.
      * @param s
      */
-  
+
     private FunctionEnum(String s)
     {
         this.s = s;

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionFactory.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionFactory.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/FunctionFactory.java Mon Sep 20 19:25:43 2010
@@ -28,15 +28,15 @@ import org.apache.torque.adapter.DB;
  * <p>This class is a "Factory class" for creating SQLFunction implementation
  * classes. It works with the DB adaptor classes to create functions that
  * are appropriate for the specified (or default) db server type.</p>
- * 
- * <p>The generic method for doing this is the 
+ *
+ * <p>The generic method for doing this is the
  * functionInstance(String, FunctionEnum, Object[]) method.  However, there are
- * a variety of convenience methods that can be used to quickly created 
+ * a variety of convenience methods that can be used to quickly created
  * specific functions, e.g. avg( Object ) and the like.</p>
- * 
+ *
  * @see SQLFunction
  * @see SummaryHelper
- * 
+ *
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id
  */
@@ -45,61 +45,61 @@ public class FunctionFactory
     /**
      * This class only has static methods and shouldn't be created.
      */
-    private FunctionFactory () 
-    {        
+    private FunctionFactory ()
+    {
     }
-    
+
     /**
      * Create an AVG SQL function implementation.
-     * 
-     * @param dbName The name of the Torque db 
-     * @param expr1 The expression to apply the function to.  Generally a 
+     *
+     * @param dbName The name of the Torque db
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
-     * @param distinct If true, the function expr will have be prefaced 
+     * @param distinct If true, the function expr will have be prefaced
      *                 with "DISTINCT", e.g. function(DISTINCT column).
      * @return The function object to use.
      * @throws Exception
      */
-    public static final SQLFunction avg ( String dbName, Object expr1, 
+    public static final SQLFunction avg ( String dbName, Object expr1,
                                           boolean distinct )
                                                          throws Exception
     {
-        return functionInstance( dbName, FunctionEnum.AVG, 
+        return functionInstance( dbName, FunctionEnum.AVG,
                                  new Object[]{ expr1, new Boolean(distinct) });
     }
     /**
      * Convenience method for creating a non-distinct function that uses
-     * the default DB.  
-     *   
-     * @param expr1 The expression to apply the function to.  Generally a 
+     * the default DB.
+     *
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
      * @return The function object to use.
-     * @throws Exception 
+     * @throws Exception
      */
-    public static final SQLFunction avg ( Object expr1 ) 
+    public static final SQLFunction avg ( Object expr1 )
                                                 throws Exception
     {
         return avg ( null, expr1, false );
     }
-    
+
     /**
      * Create a COUNT SQL function implementation.
-     * 
-     * @param dbName The name of the Torque db 
-     * @param expr1 The expression to apply the function to.  Generally a 
+     *
+     * @param dbName The name of the Torque db
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
-     * @param distinct If true, the function expr will have be prefaced 
+     * @param distinct If true, the function expr will have be prefaced
      *                 with "DISTINCT", e.g. function(DISTINCT column).
      * @return The function object to use.
      * @throws Exception
      */
-    public static final SQLFunction count ( String dbName, Object expr1, 
+    public static final SQLFunction count ( String dbName, Object expr1,
                                           boolean distinct )
                                                          throws Exception
     {
@@ -108,35 +108,35 @@ public class FunctionFactory
     }
     /**
      * Convenience method for creating a non-distinct function that uses
-     * the default DB.  
-     *   
-     * @param expr1 The expression to apply the function to.  Generally a 
+     * the default DB.
+     *
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
      * @return The function object to use.
-     * @throws Exception 
+     * @throws Exception
      */
-    public static final SQLFunction count ( Object expr1 ) 
+    public static final SQLFunction count ( Object expr1 )
                                                 throws Exception
     {
         return count ( null, expr1, false );
     }
-    
+
     /**
      * Create a MAX SQL function implementation.
-     * 
-     * @param dbName The name of the Torque db 
-     * @param expr1 The expression to apply the function to.  Generally a 
+     *
+     * @param dbName The name of the Torque db
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
-     * @param distinct If true, the function expr will have be prefaced 
+     * @param distinct If true, the function expr will have be prefaced
      *                 with "DISTINCT", e.g. function(DISTINCT column).
      * @return The function object to use.
      * @throws Exception
      */
-    public static final SQLFunction max ( String dbName, Object expr1, 
+    public static final SQLFunction max ( String dbName, Object expr1,
                                           boolean distinct )
                                                          throws Exception
     {
@@ -145,35 +145,35 @@ public class FunctionFactory
     }
     /**
      * Convenience method for creating a non-distinct function that uses
-     * the default DB.  
-     *   
-     * @param expr1 The expression to apply the function to.  Generally a 
+     * the default DB.
+     *
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
      * @return The function object to use.
-     * @throws Exception 
+     * @throws Exception
      */
-    public static final SQLFunction max ( Object expr1 ) 
+    public static final SQLFunction max ( Object expr1 )
                                                 throws Exception
     {
         return max ( null, expr1, false );
     }
-    
+
     /**
      * Create a MIN SQL function implementation.
-     * 
-     * @param dbName The name of the Torque db 
-     * @param expr1 The expression to apply the function to.  Generally a 
+     *
+     * @param dbName The name of the Torque db
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
-     * @param distinct If true, the function expr will have be prefaced 
+     * @param distinct If true, the function expr will have be prefaced
      *                 with "DISTINCT", e.g. function(DISTINCT column).
      * @return The function object to use.
      * @throws Exception
      */
-    public static final SQLFunction min ( String dbName, Object expr1, 
+    public static final SQLFunction min ( String dbName, Object expr1,
                                           boolean distinct )
                                                          throws Exception
     {
@@ -182,35 +182,35 @@ public class FunctionFactory
     }
     /**
      * Convenience method for creating a non-distinct function that uses
-     * the default DB.  
-     *   
-     * @param expr1 The expression to apply the function to.  Generally a 
+     * the default DB.
+     *
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
      * @return The function object to use.
-     * @throws Exception 
+     * @throws Exception
      */
-    public static final SQLFunction min ( Object expr1 ) 
+    public static final SQLFunction min ( Object expr1 )
                                                 throws Exception
     {
         return min ( null, expr1, false );
     }
-    
+
     /**
      * Create a SUM SQL function implementation.
-     * 
-     * @param dbName The name of the Torque db 
-     * @param expr1 The expression to apply the function to.  Generally a 
+     *
+     * @param dbName The name of the Torque db
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
-     * @param distinct If true, the function expr will have be prefaced 
+     * @param distinct If true, the function expr will have be prefaced
      *                 with "DISTINCT", e.g. function(DISTINCT column).
      * @return The function object to use.
      * @throws Exception
      */
-    public static final SQLFunction sum ( String dbName, Object expr1, 
+    public static final SQLFunction sum ( String dbName, Object expr1,
                                           boolean distinct )
                                                          throws Exception
     {
@@ -219,59 +219,59 @@ public class FunctionFactory
     }
     /**
      * Convenience method for creating a non-distinct function that uses
-     * the default DB.  
-     *   
-     * @param expr1 The expression to apply the function to.  Generally a 
+     * the default DB.
+     *
+     * @param expr1 The expression to apply the function to.  Generally a
      *              column name in table.column format.  It is assumed
      *              that the "toString()" method of this object will be
      *              acceptable for an argument.
      * @return The function object to use.
-     * @throws Exception 
+     * @throws Exception
      */
-    public static final SQLFunction sum ( Object expr1 ) 
+    public static final SQLFunction sum ( Object expr1 )
                                                 throws Exception
     {
         return sum ( null, expr1, false );
     }
-    
+
     /**
      * "Generic" function class creation method.
-     * 
-     * @param dbName  The name of the Torque DB this function applies to or 
+     *
+     * @param dbName  The name of the Torque DB this function applies to or
      *                the default Torque DB if null.
      * @param function  The function to create an object for.
      * @param arguments The arguments required by the function object.
-     * @return A SQLFunction implementation that for the specified DB server. 
+     * @return A SQLFunction implementation that for the specified DB server.
      * @throws Exception
      */
-    public static final SQLFunction functionInstance ( String dbName, 
+    public static final SQLFunction functionInstance ( String dbName,
                                                        FunctionEnum function,
                                                        Object[] arguments )
-                                                           throws Exception 
+                                                           throws Exception
    {
         DB dbAdaptor = null;
         if ( dbName != null ) {
            dbAdaptor = Torque.getDB(dbName);
-        } 
-        else 
+        }
+        else
         {
             dbAdaptor = Torque.getDB(Torque.getDefaultDB());
         }
         Class fClass = dbAdaptor.getFunctionClass( function );
-        if ( fClass == null ) 
+        if ( fClass == null )
         {
             throw new IllegalArgumentException(
               "Could not find function class for '"+ function.toString() +"'");
         }
 
         Object fInstance = null;
-        
-        // Check if class is an inner class 
+
+        // Check if class is an inner class
         Class outerClass = fClass.getDeclaringClass();
-        if ( outerClass != null ) 
+        if ( outerClass != null )
         {
             Object oInstance = outerClass.newInstance();
-            Constructor iConstructor = 
+            Constructor iConstructor =
                 fClass.getDeclaredConstructor( new Class[] { outerClass } );
             fInstance = iConstructor.newInstance( new Object[] { oInstance });
         }
@@ -282,13 +282,13 @@ public class FunctionFactory
         SQLFunction func = (SQLFunction) fInstance;
         func.setArguments( arguments );
         func.setDBName( dbName );
-        
+
         return func;
    }
 
     public static final SQLFunction functionInstance ( FunctionEnum function,
                                                        Object[] arguments )
-                                                           throws Exception 
+                                                           throws Exception
    {
         return functionInstance ( null, function, arguments );
    }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/SQLFunction.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/SQLFunction.java?rev=999072&r1=999071&r2=999072&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/SQLFunction.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/functions/SQLFunction.java Mon Sep 20 19:25:43 2010
@@ -21,13 +21,13 @@ package org.apache.torque.util.functions
 
 /**
  * Define the basic methods that classes that support SQL Functions
- * need to implement for Classes that use them.  This is intended to 
- * allow code to be written before functions are fully integrated 
+ * need to implement for Classes that use them.  This is intended to
+ * allow code to be written before functions are fully integrated
  * with the DBAdaptors.  As well as allowing for functions to
- * expand as needed. 
- * 
+ * expand as needed.
+ *
  * @see FunctionFactory
- * 
+ *
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id
  */
@@ -37,52 +37,52 @@ public interface SQLFunction
      * This should return the SQL string that can be used
      * when constructing the query.  E.g. "AVG( table.column )" or
      * CONCAT(table.column, " foobar");
-     *  
+     *
      * @return The SQL String.
      */
     public abstract String toSQL();
-    
+
     /**
      * Return a string representation of the function parameters
      * at index i.  Should be null if parameter does not exist.
-     * 
+     *
      * @param i The 0 based parameter to get.
      * @return A String representation of the parameter.  Null if one does not
      *         exist.
      */
     public abstract String getArgument( int i );
-    
+
     /**
-     * Return all the parameters as an object array. This allow for 
+     * Return all the parameters as an object array. This allow for
      * processing of the parameters in their original format rather
      * than just in String format.  E.g. a parameter might be specified
      * as a Date object, or a Column object.
-     * 
-     * @return Should return a valid Object array and not null.  E.g. 
+     *
+     * @return Should return a valid Object array and not null.  E.g.
      *  implementors should return new Object[0] if there are no parameters.
      */
     public abstract Object[] getArguments();
-    
+
     /**
-     * Sets the function specific arguments.  Note, this should generally 
+     * Sets the function specific arguments.  Note, this should generally
      * only be called by FunctionFactory.
-     * 
+     *
      * @param args The function specific arguments.
      */
     public abstract void setArguments( Object[] args );
-    
+
     /**
      * Get the name of the Torque Database associated with this function.
-     * 
+     *
      * @return The DB name.  Should not be null (use default DB in this case).
      * @exception IllegalStateException If Torque has not been initialized and
      *   the default DB name can not be determined.
      */
     public abstract String getDBName() throws IllegalStateException;
-    
+
     /**
      * Sets the Torque DB name this function is being used with.
-     * 
+     *
      * @param dbName The DB name, if null, the getDBName will return default DB
      *               name (if it can be determined).
      */



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