db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r430888 - in /db/torque: site/trunk/xdocs/changes.xml templates/trunk/src/templates/om/Peer.vm
Date Fri, 11 Aug 2006 20:37:12 GMT
Author: tfischer
Date: Fri Aug 11 13:37:11 2006
New Revision: 430888

URL: http://svn.apache.org/viewvc?rev=430888&view=rev
Log:
Provided generic-typed wrappers for methods in BasePeer wehn torque.enabelJava5Features is
true.
Thanks to Thoralf Rickert for the patch.
Fixes TORQUE-31.

Modified:
    db/torque/site/trunk/xdocs/changes.xml
    db/torque/templates/trunk/src/templates/om/Peer.vm

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?rev=430888&r1=430887&r2=430888&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Fri Aug 11 13:37:11 2006
@@ -29,6 +29,10 @@
 
   <release version="3.2.1-dev" date="in SVN">
   
+    <action type="update" dev="tfischer" issue="TORQUE-31" due-to="Thoralf Rickert">
+      Provided generic typed wrappers for methods in BasePeer
+      when torque.enableJava5Features is set to true.
+    </action>
     <action type="update" dev="tfischer" issue="TORQUE-37" due-to="Greg Monroe">
       The default package for generated classes was changed from 
       <code>org.apache.torque</code> to <code>torque.generated</code>.

Modified: db/torque/templates/trunk/src/templates/om/Peer.vm
URL: http://svn.apache.org/viewvc/db/torque/templates/trunk/src/templates/om/Peer.vm?rev=430888&r1=430887&r2=430888&view=diff
==============================================================================
--- db/torque/templates/trunk/src/templates/om/Peer.vm (original)
+++ db/torque/templates/trunk/src/templates/om/Peer.vm Fri Aug 11 13:37:11 2006
@@ -1461,4 +1461,252 @@
             crit.setDbName(DATABASE_NAME);
         }
     }
+    
+
+#if($enableJava5Features)
+    // The following methods wrap some methods in BasePeer
+    // to have more support for Java5 generic types in the Peer
+    
+    /**
+     * Utility method which executes a given sql statement.  This
+     * method should be used for select statements only.  Use
+     * executeStatement for update, insert, and delete operations.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String)
+     */
+    public static List<Record> executeQuery(String queryString) throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString);
+    }
+
+    /**
+     * Utility method which executes a given sql statement.  This
+     * method should be used for select statements only.  Use
+     * executeStatement for update, insert, and delete operations.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @param dbName The database to connect to.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String,String)
+     */
+    public static List<Record> executeQuery(String queryString, String dbName)
+        throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString,dbName);
+    }
+    
+
+    /**
+     * Method for performing a SELECT.  Returns all results.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @param dbName The database to connect to.
+     * @param singleRecord Whether or not we want to select only a
+     * single record.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String,String,boolean)
+     */
+    public static List<Record> executeQuery(
+        String queryString,
+        String dbName,
+        boolean singleRecord)
+        throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString,dbName,singleRecord);
+    }
+
+    /**
+     * Method for performing a SELECT.  Returns all results.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @param singleRecord Whether or not we want to select only a
+     * single record.
+     * @param con A Connection.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String,boolean,Connection)
+     */
+    public static List<Record> executeQuery(
+        String queryString,
+        boolean singleRecord,
+        Connection con)
+        throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString,singleRecord,con);
+    }
+
+    /**
+     * Method for performing a SELECT.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @param start The first row to return.
+     * @param numberOfResults The number of rows to return.
+     * @param dbName The database to connect to.
+     * @param singleRecord Whether or not we want to select only a
+     * single record.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String,int,int,String,boolean)
+     */
+    public static List<Record> executeQuery(
+        String queryString,
+        int start,
+        int numberOfResults,
+        String dbName,
+        boolean singleRecord)
+        throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString,start,numberOfResults,dbName,singleRecord);
+    }
+
+    /**
+     * Method for performing a SELECT.  Returns all results.
+     *
+     * @param queryString A String with the sql statement to execute.
+     * @param start The first row to return.
+     * @param numberOfResults The number of rows to return.
+     * @param singleRecord Whether or not we want to select only a
+     * single record.
+     * @param con A Connection.
+     * @return List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#executeQuery(String,int,int,String,boolean,Connection)
+     */
+    public static List<Record> executeQuery(
+        String queryString,
+        int start,
+        int numberOfResults,
+        boolean singleRecord,
+        Connection con)
+        throws TorqueException
+    {
+        return BasePeer.executeQuery(queryString,start,numberOfResults,singleRecord,con);
+    }
+
+    /**
+     * Returns all records in a QueryDataSet as a List of Record
+     * objects.  Used for functionality like util.LargeSelect.
+     *
+     * @see #getSelectResults(QueryDataSet, int, int, boolean)
+     * @param qds the QueryDataSet
+     * @return a List of Record objects
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#getSelectResults(QueryDataSet)
+     */
+    public static List<Record> getSelectResults(QueryDataSet qds)
+        throws TorqueException
+    {
+        return BasePeer.getSelectResults(qds);
+    }
+    
+    /**
+     * Returns all records in a QueryDataSet as a List of Record
+     * objects.  Used for functionality like util.LargeSelect.
+     *
+     * @see #getSelectResults(QueryDataSet, int, int, boolean)
+     * @param qds the QueryDataSet
+     * @param singleRecord
+     * @return a List of Record objects
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#getSelectResults(QueryDataSet,boolean)
+     */
+    public static List<Record> getSelectResults(QueryDataSet qds, boolean singleRecord)
+        throws TorqueException
+    {
+        return BasePeer.getSelectResults(qds,singleRecord);
+    }
+    
+    /**
+     * Returns numberOfResults records in a QueryDataSet as a List
+     * of Record objects.  Starting at record 0.  Used for
+     * functionality like util.LargeSelect.
+     *
+     * @see #getSelectResults(QueryDataSet, int, int, boolean)
+     * @param qds the QueryDataSet
+     * @param numberOfResults
+     * @param singleRecord
+     * @return a List of Record objects
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#getSelectResults(QueryDataSet,int,boolean)
+     */
+    public static List<Record> getSelectResults(
+        QueryDataSet qds,
+        int numberOfResults,
+        boolean singleRecord)
+        throws TorqueException
+    {
+        return BasePeer.getSelectResults(qds,numberOfResults,singleRecord);
+    }
+
+    /**
+     * Returns numberOfResults records in a QueryDataSet as a List
+     * of Record objects.  Starting at record start.  Used for
+     * functionality like util.LargeSelect.
+     *
+     * @param qds The <code>QueryDataSet</code> to extract results
+     * from.
+     * @param start The index from which to start retrieving
+     * <code>Record</code> objects from the data set.
+     * @param numberOfResults The number of results to return (or
+     * <code> -1</code> for all results).
+     * @param singleRecord Whether or not we want to select only a
+     * single record.
+     * @return A <code>List</code> of <code>Record</code> objects.
+     * @exception TorqueException If any <code>Exception</code> occurs.
+     * @see org.apache.torque.util.BasePeer#getSelectResults(QueryDataSet,int,int,boolean)
+     */
+    public static List getSelectResults(
+        QueryDataSet qds,
+        int start,
+        int numberOfResults,
+        boolean singleRecord)
+        throws TorqueException
+    {
+        return BasePeer.getSelectResults(qds,start,numberOfResults,singleRecord);
+    }
+
+    /**
+     * Performs a SQL <code>select</code> using a PreparedStatement.
+     * Note: this method does not handle null criteria values.
+     *
+     * @param criteria
+     * @param con
+     * @return a List of Record objects.
+     * @throws TorqueException Error performing database query.
+     * @see org.apache.torque.util.BasePeer#doPSSelect(Criteria,Connection)
+     */
+    public static List<Record> doPSSelect(Criteria criteria, Connection con)
+        throws TorqueException
+    {
+        return BasePeer.doPSSelect(criteria,con);
+    }
+
+    /**
+     * Do a Prepared Statement select according to the given criteria
+     *
+     * @param criteria
+     * @return a List of Record objects.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     * @see org.apache.torque.util.BasePeer#doPSSelect(Criteria)
+     */
+    public static List<Record> doPSSelect(Criteria criteria) throws TorqueException
+    {
+        return BasePeer.doPSSelect(criteria);
+    }
+#end
 }



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