db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1355228 [1/2] - in /db/torque/torque4/trunk/torque-runtime/src: main/java/org/apache/torque/ main/java/org/apache/torque/adapter/ main/java/org/apache/torque/avalon/ main/java/org/apache/torque/oid/ main/java/org/apache/torque/sql/ main/ja...
Date Fri, 29 Jun 2012 03:38:12 GMT
Author: tfischer
Date: Fri Jun 29 03:38:08 2012
New Revision: 1355228

URL: http://svn.apache.org/viewvc?rev=1355228&view=rev
Log:
TORQUE-216: Rename class DB to Adapter 

Added:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java
      - copied, changed from r1348302, 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/Adapter.java
      - copied, changed from r1348302, 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/adapter/AdapterFactory.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DerbyAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/HsqldbAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MssqlAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MysqlAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/NoneAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/PostgresAdapter.java
      - copied, changed from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java
Removed:
    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/adapter/DBDerby.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java
Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
    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/avalon/Torque.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectPsPartBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CurrentDateTimePsPartBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CustomBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/InBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/LikeBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/NullValueBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/StandardBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/VerbatimSqlConditionBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/WhereClausePsPartBuilder.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/TorqueInstanceTest.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/adapter/DBOracleTest.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Database.java Fri Jun 29 03:38:08 2012
@@ -22,7 +22,7 @@ package org.apache.torque;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.adapter.IDMethod;
 import org.apache.torque.dsfactory.DataSourceFactory;
 import org.apache.torque.map.ColumnMap;
@@ -46,7 +46,7 @@ public class Database
     /**
      * The Database adapter which encapsulates database-specific peculiarities.
      */
-    private DB adapter;
+    private Adapter adapter;
 
     /**
      * the Map of this database.
@@ -98,7 +98,7 @@ public class Database
      *
      * @return the adapter to this database, or null if no adapter is set.
      */
-    public DB getAdapter()
+    public Adapter getAdapter()
     {
         return adapter;
     }
@@ -109,7 +109,7 @@ public class Database
      * @param anAdapter The adapter for this database, or null to remove the
      *        current adapter from this database.
      */
-    public void setAdapter(DB anAdapter)
+    public void setAdapter(Adapter anAdapter)
     {
         this.adapter = anAdapter;
     }

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=1355228&r1=1355227&r2=1355228&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 Fri Jun 29 03:38:08 2012
@@ -23,7 +23,7 @@ import java.sql.Connection;
 import java.util.Map;
 
 import org.apache.commons.configuration.Configuration;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.manager.AbstractBaseManager;
 import org.apache.torque.map.DatabaseMap;
 import org.apache.torque.oid.IDBroker;
@@ -333,13 +333,32 @@ public final class Torque
      *
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
+     *
+     * @deprecated use getAdapter(String) instead.
+     *             This method will be removed in a future version of Torque.
      */
-    public static DB getDB(String name) throws TorqueException
+    @Deprecated
+    public static Adapter getDB(String name) throws TorqueException
     {
         return getInstance().getDB(name);
     }
 
     /**
+     * Returns the database adapter for a specific database name.
+     *
+     * @param name the database name, or null for the default db.
+     *
+     * @return The corresponding database adapter.
+     *
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     */
+    public static Adapter getAdapter(String name) throws TorqueException
+    {
+        return getInstance().getAdapter(name);
+    }
+
+    /**
      * Returns the name of the default database.
      *
      * @return name of the default DB, or null if Torque is not initialized yet

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=1355228&r1=1355227&r2=1355228&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 Fri Jun 29 03:38:08 2012
@@ -34,8 +34,8 @@ import org.apache.commons.configuration.
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.torque.adapter.DB;
-import org.apache.torque.adapter.DBFactory;
+import org.apache.torque.adapter.Adapter;
+import org.apache.torque.adapter.AdapterFactory;
 import org.apache.torque.dsfactory.DataSourceFactory;
 import org.apache.torque.manager.AbstractBaseManager;
 import org.apache.torque.map.DatabaseMap;
@@ -305,23 +305,25 @@ public class TorqueInstance
             for (Iterator<?> it = c.getKeys(); it.hasNext();)
             {
                 String key = (String) it.next();
-                if (key.endsWith(DB.ADAPTER_KEY)
-                        || key.endsWith(DB.DRIVER_KEY))
+                if (key.endsWith(Adapter.ADAPTER_KEY)
+                        || key.endsWith(Adapter.DRIVER_KEY))
                 {
-                    String adapter = c.getString(key);
+                    String adapterKey = c.getString(key);
                     String handle = key.substring(0, key.indexOf('.'));
 
                     Database database = getOrCreateDatabase(handle);
-                    DB db = null;
+                    Adapter adapter = null;
 
-                    if (StringUtils.equals(DB.AUTODETECT_ADAPTER, adapter))
+                    if (StringUtils.equals(
+                            Adapter.AUTODETECT_ADAPTER,
+                            adapterKey))
                     {
                         Connection con = null;
                         try
                         {
                             con = database.getDataSourceFactory()
                                     .getDataSource().getConnection();
-                            db = DBFactory.autoDetectAdapter(con);
+                            adapter = AdapterFactory.autoDetectAdapter(con);
                         }
                         catch (SQLException e)
                         {
@@ -336,20 +338,22 @@ public class TorqueInstance
                     }
                     else
                     {
-                        db = DBFactory.create(adapter);
+                        adapter = AdapterFactory.create(adapterKey);
                     }
 
                     // Not supported, try manually defined adapter class
-                    if (db == null)
+                    if (adapter == null)
                     {
                         String adapterClassName = c.getString(
-                                key + "." + adapter + ".className", null);
-                        db = DBFactory.create(adapter, adapterClassName);
+                                key + "." + adapterKey + ".className", null);
+                        adapter = AdapterFactory.create(
+                                adapterKey,
+                                adapterClassName);
                     }
 
                     // register the adapter for this name
-                    database.setAdapter(db);
-                    log.debug("Adding " + adapter + " -> "
+                    database.setAdapter(adapter);
+                    log.debug("Adding " + adapterKey + " -> "
                             + handle + " as Adapter");
 
                     // add Id generators
@@ -359,7 +363,7 @@ public class TorqueInstance
                     {
                         database.addIdGenerator(
                                 IDGeneratorFactory.ID_GENERATOR_METHODS[i],
-                                IDGeneratorFactory.create(db, handle));
+                                IDGeneratorFactory.create(adapter, handle));
                     }
                 }
             }
@@ -385,7 +389,7 @@ public class TorqueInstance
                     + "."
                     + getDefaultDB()
                     + "."
-                    + DB.ADAPTER_KEY;
+                    + Adapter.ADAPTER_KEY;
             log.error(error);
             throw new TorqueException(error);
         }
@@ -1075,8 +1079,32 @@ public class TorqueInstance
      *
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
+     *
+     * @deprecated use getAdapter(String) instead.
+     *             This method will be removed in a future version of Torque.
+     */
+    @Deprecated
+    public Adapter getDB(String name) throws TorqueException
+    {
+        Database database = getDatabase(name);
+        if (database == null)
+        {
+            return null;
+        }
+        return database.getAdapter();
+    }
+
+    /**
+     * Returns the database adapter for a specific database.
+     *
+     * @param name the database name, or null for the default db.
+     *
+     * @return The corresponding database adapter, or null if no database
+     *         adapter is defined for the given database.
+     *
+     * @throws TorqueException If Torque is not initialized.
      */
-    public DB getDB(String name) throws TorqueException
+    public Adapter getAdapter(String name) throws TorqueException
     {
         Database database = getDatabase(name);
         if (database == null)

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java (from r1348302, 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/AbstractAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AbstractDBAdapter.java&r1=1348302&r2=1355228&rev=1355228&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/AbstractAdapter.java Fri Jun 29 03:38:08 2012
@@ -46,7 +46,7 @@ import org.apache.torque.sql.Query;
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id$
  */
-public abstract class AbstractDBAdapter implements DB
+public abstract class AbstractAdapter implements Adapter
 {
     /** Serial version UID. */
     private static final long serialVersionUID = 1L;
@@ -54,8 +54,9 @@ public abstract class AbstractDBAdapter 
     /**
      * Empty constructor.
      */
-    protected AbstractDBAdapter()
+    protected AbstractAdapter()
     {
+        // empty
     }
 
     /**

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/Adapter.java (from r1348302, 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/Adapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/Adapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DB.java&r1=1348302&r2=1355228&rev=1355228&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/Adapter.java Fri Jun 29 03:38:08 2012
@@ -53,7 +53,7 @@ import org.apache.torque.sql.Query;
  * @author <a href="mailto:greg.monroe@dukece.com">Greg Monroe</a>
  * @version $Id$
  */
-public interface DB extends Serializable
+public interface Adapter extends Serializable
 {
     /** Key for the configuration which contains database adapters. */
     String ADAPTER_KEY = "adapter";

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AdapterFactory.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AdapterFactory.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AdapterFactory.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/AdapterFactory.java Fri Jun 29 03:38:08 2012
@@ -29,7 +29,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
- * This class creates different {@link org.apache.torque.adapter.DB}
+ * This class creates different {@link org.apache.torque.adapter.Adapter}
  * objects based on specified JDBC driver name.
  *
  * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
@@ -40,52 +40,52 @@ import org.apache.commons.logging.LogFac
  * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
  * @version $Id$
  */
-public final class DBFactory
+public final class AdapterFactory
 {
     /** Local logger */
-    private static final Log log = LogFactory.getLog(DBFactory.class);
+    private static final Log log = LogFactory.getLog(AdapterFactory.class);
 
     /**
      * JDBC driver to Torque Adapter map.
      */
-    private static Map<String, Class<? extends DB>> adapters
-            = new HashMap<String, Class<? extends DB>>();
+    private static Map<String, Class<? extends Adapter>> adapters
+            = new HashMap<String, Class<? extends Adapter>>();
 
     /**
      * Initialize the JDBC driver to Torque Adapter map.
      */
     static
     {
-        adapters.put("org.hsql.jdbcDriver", DBHsqldb.class);
-        adapters.put("org.hsqldb.jdbcDriver", DBHsqldb.class);
+        adapters.put("org.hsql.jdbcDriver", HsqldbAdapter.class);
+        adapters.put("org.hsqldb.jdbcDriver", HsqldbAdapter.class);
         adapters.put("com.microsoft.jdbc.sqlserver.SQLServerDriver",
-            DBMSSQL.class);
-        adapters.put("com.jnetdirect.jsql.JSQLDriver", DBMSSQL.class);
-        adapters.put("org.gjt.mm.mysql.Driver", DBMM.class);
-        adapters.put("oracle.jdbc.driver.OracleDriver", DBOracle.class);
-        adapters.put("org.postgresql.Driver", DBPostgres.class);
+            MssqlAdapter.class);
+        adapters.put("com.jnetdirect.jsql.JSQLDriver", MssqlAdapter.class);
+        adapters.put("org.gjt.mm.mysql.Driver", MysqlAdapter.class);
+        adapters.put("oracle.jdbc.driver.OracleDriver", OracleAdapter.class);
+        adapters.put("org.postgresql.Driver", PostgresAdapter.class);
 
-        adapters.put("org.apache.derby.jdbc.EmbeddedDriver", DBDerby.class);
+        adapters.put("org.apache.derby.jdbc.EmbeddedDriver", DerbyAdapter.class);
 
 
         // add some short names to be used when drivers are not used
-        adapters.put("hsqldb", DBHsqldb.class);
-        adapters.put("mssql", DBMSSQL.class);
-        adapters.put("mysql", DBMM.class);
-        adapters.put("oracle", DBOracle.class);
-        adapters.put("postgresql", DBPostgres.class);
-        adapters.put("derby", DBDerby.class);
+        adapters.put("hsqldb", HsqldbAdapter.class);
+        adapters.put("mssql", MssqlAdapter.class);
+        adapters.put("mysql", MysqlAdapter.class);
+        adapters.put("oracle", OracleAdapter.class);
+        adapters.put("postgresql", PostgresAdapter.class);
+        adapters.put("derby", DerbyAdapter.class);
 
         // add database product names to be used for auto-detection
-        adapters.put("HSQL Database Engine", DBHsqldb.class);
-        adapters.put("Microsoft SQL Server Database", DBMSSQL.class);
-        adapters.put("Microsoft SQL Server", DBMSSQL.class);
-        adapters.put("MySQL", DBMM.class);
-        adapters.put("Oracle", DBOracle.class);
-        adapters.put("PostgreSQL", DBPostgres.class);
-        adapters.put("Apache Derby", DBDerby.class);
+        adapters.put("HSQL Database Engine", HsqldbAdapter.class);
+        adapters.put("Microsoft SQL Server Database", MssqlAdapter.class);
+        adapters.put("Microsoft SQL Server", MssqlAdapter.class);
+        adapters.put("MySQL", MysqlAdapter.class);
+        adapters.put("Oracle", OracleAdapter.class);
+        adapters.put("PostgreSQL", PostgresAdapter.class);
+        adapters.put("Apache Derby", DerbyAdapter.class);
 
-        adapters.put("", DBNone.class);
+        adapters.put("", NoneAdapter.class);
     }
 
     /**
@@ -93,7 +93,7 @@ public final class DBFactory
      *
      * Class contains only static methods, so no instances are needed.
      */
-    private DBFactory()
+    private AdapterFactory()
     {
     }
 
@@ -108,13 +108,13 @@ public final class DBFactory
      *         instantiated
      * @throws SQLException if there are problems getting the JDBC meta data
      */
-    public static DB autoDetectAdapter(Connection con)
+    public static Adapter autoDetectAdapter(Connection con)
         throws InstantiationException, SQLException
     {
         DatabaseMetaData dmd = con.getMetaData();
         String dbmsName = dmd.getDatabaseProductName();
 
-        Class<? extends DB> adapterClass = adapters.get(dbmsName);
+        Class<? extends Adapter> adapterClass = adapters.get(dbmsName);
 
         if (adapterClass == null)
         {
@@ -125,7 +125,7 @@ public final class DBFactory
 
         try
         {
-            DB adapter = adapterClass.newInstance();
+            Adapter adapter = adapterClass.newInstance();
             return adapter;
         }
         catch (IllegalAccessException e)
@@ -148,10 +148,10 @@ public final class DBFactory
      * @throws InstantiationException throws if the adapter could not be
      *         instantiated
      */
-    public static DB create(String key)
+    public static Adapter create(String key)
         throws InstantiationException
     {
-        Class<? extends DB> adapterClass = adapters.get(key);
+        Class<? extends Adapter> adapterClass = adapters.get(key);
 
         if (adapterClass == null)
         {
@@ -160,8 +160,7 @@ public final class DBFactory
 
         try
         {
-            DB adapter = adapterClass.newInstance();
-            // adapter.setJDBCDriver(driver);
+            Adapter adapter = adapterClass.newInstance();
             return adapter;
         }
         catch (IllegalAccessException e)
@@ -185,7 +184,7 @@ public final class DBFactory
      *         instantiated
      */
     @SuppressWarnings("unchecked")
-    public static DB create(String key, String className)
+    public static Adapter create(String key, String className)
         throws InstantiationException
     {
         Class<?> adapterClass;
@@ -206,8 +205,8 @@ public final class DBFactory
 
         try
         {
-            DB adapter = (DB) adapterClass.newInstance();
-            adapters.put(key, (Class<? extends DB>) adapterClass);
+            Adapter adapter = (Adapter) adapterClass.newInstance();
+            adapters.put(key, (Class<? extends Adapter>) adapterClass);
             return adapter;
         }
         catch (IllegalAccessException e)

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DerbyAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DerbyAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DerbyAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBDerby.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DerbyAdapter.java Fri Jun 29 03:38:08 2012
@@ -33,7 +33,7 @@ import org.apache.commons.logging.LogFac
  * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
  * @version $Id$
  */
-public class DBDerby extends AbstractDBAdapter
+public class DerbyAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -41,13 +41,14 @@ public class DBDerby extends AbstractDBA
     private static final long serialVersionUID = 6265962681516206415L;
 
     /** The class log. */
-    private static Log log = LogFactory.getLog(DBDerby.class);
+    private static Log log = LogFactory.getLog(DerbyAdapter.class);
 
     /**
      * Empty constructor.
      */
-    protected DBDerby()
+    protected DerbyAdapter()
     {
+        // empty
     }
 
     /**
@@ -78,7 +79,7 @@ public class DBDerby extends AbstractDBA
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -91,7 +92,7 @@ public class DBDerby extends AbstractDBA
      * inserted, which in this case is
      * <code>VALUES IDENTITY_VAL_LOCAL()</code>.
      *
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object obj)
      */
     @Override
     public String getIDMethodSQL(Object obj)
@@ -148,6 +149,7 @@ public class DBDerby extends AbstractDBA
     public void unlockTable(Connection con, String table)
             throws SQLException
     {
+        // empty
     }
 
     /**

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/HsqldbAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/HsqldbAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/HsqldbAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/HsqldbAdapter.java Fri Jun 29 03:38:08 2012
@@ -30,7 +30,7 @@ import java.sql.SQLException;
  * @author <a href="mailto:celkins@scardini.com">Christopher Elkins</a>
  * @version $Id$
  */
-public class DBHsqldb extends AbstractDBAdapter
+public class HsqldbAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -40,8 +40,9 @@ public class DBHsqldb extends AbstractDB
     /**
      * Constructor.
      */
-    protected DBHsqldb()
+    protected HsqldbAdapter()
     {
+        // empty
     }
 
     /**
@@ -70,7 +71,7 @@ public class DBHsqldb extends AbstractDB
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -79,7 +80,7 @@ public class DBHsqldb extends AbstractDB
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#ignoreCaseInOrderBy(String)
+     * @see org.apache.torque.adapter.Adapter#ignoreCaseInOrderBy(String)
      */
     @Override
     public String ignoreCaseInOrderBy(String in)
@@ -88,7 +89,7 @@ public class DBHsqldb extends AbstractDB
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object obj)
      */
     @Override
     public String getIDMethodSQL(Object obj)
@@ -109,6 +110,7 @@ public class DBHsqldb extends AbstractDB
     @Override
     public void lockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 
     /**
@@ -121,6 +123,7 @@ public class DBHsqldb extends AbstractDB
     @Override
     public void unlockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 
     /**

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MssqlAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MssqlAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MssqlAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMSSQL.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MssqlAdapter.java Fri Jun 29 03:38:08 2012
@@ -35,7 +35,7 @@ import org.apache.torque.sql.Query;
  * @author <a href="mailto:gonzalo.diethelm@sonda.com">Gonzalo Diethelm</a>
  * @version $Id$
  */
-public class DBMSSQL extends AbstractDBAdapter
+public class MssqlAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -43,13 +43,14 @@ public class DBMSSQL extends AbstractDBA
     private static final long serialVersionUID = -2924485528975497044L;
 
     /** The class logger. */
-    private static final Log log = LogFactory.getLog(DBMSSQL.class);
+    private static final Log log = LogFactory.getLog(MssqlAdapter.class);
 
     /**
      * Empty constructor.
      */
-    protected DBMSSQL()
+    protected MssqlAdapter()
     {
+        // empty
     }
 
     /**
@@ -77,7 +78,7 @@ public class DBMSSQL extends AbstractDBA
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -90,7 +91,7 @@ public class DBMSSQL extends AbstractDBA
      * per-session basis from the global variable
      * <code>@@identity</code>).
      *
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object obj)
      */
     @Override
     public String getIDMethodSQL(Object unused)
@@ -147,7 +148,7 @@ public class DBMSSQL extends AbstractDBA
 
     /**
      * Return true for Sybase
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeLimit()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeLimit()
      */
     @Override
     public boolean supportsNativeLimit()
@@ -192,7 +193,7 @@ public class DBMSSQL extends AbstractDBA
      * so false is returned.
      *
      * @return false
-     * @see org.apache.torque.adapter.DB#escapeText()
+     * @see org.apache.torque.adapter.Adapter#escapeText()
      */
     @Override
     public boolean escapeText()

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MysqlAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MysqlAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MysqlAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBMM.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/MysqlAdapter.java Fri Jun 29 03:38:08 2012
@@ -42,7 +42,7 @@ import org.apache.torque.sql.Query;
  * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  * @version $Id$
  */
-public class DBMM extends AbstractDBAdapter
+public class MysqlAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -50,13 +50,14 @@ public class DBMM extends AbstractDBAdap
     private static final long serialVersionUID = 7547291410802807010L;
 
     /** The class log. */
-    private static Log log = LogFactory.getLog(DBDerby.class);
+    private static Log log = LogFactory.getLog(DerbyAdapter.class);
 
     /**
      * Empty protected constructor.
      */
-    protected DBMM()
+    protected MysqlAdapter()
     {
+        // empty
     }
 
     /**
@@ -84,7 +85,7 @@ public class DBMM extends AbstractDBAdap
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -97,7 +98,7 @@ public class DBMM extends AbstractDBAdap
      * inserted, which in this case is <code>SELECT
      * LAST_INSERT_ID()</code>.
      *
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object obj)
      */
     @Override
     public String getIDMethodSQL(Object obj)
@@ -216,7 +217,7 @@ public class DBMM extends AbstractDBAdap
 
     /**
      * Return true for MySQL
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeLimit()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeLimit()
      */
     @Override
     public boolean supportsNativeLimit()
@@ -226,7 +227,7 @@ public class DBMM extends AbstractDBAdap
 
     /**
      * Return true for MySQL
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeOffset()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeOffset()
      */
     @Override
     public boolean supportsNativeOffset()

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/NoneAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/NoneAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/NoneAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBNone.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/NoneAdapter.java Fri Jun 29 03:38:08 2012
@@ -30,7 +30,7 @@ import java.sql.SQLException;
  * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
  * @version $Id$
  */
-public class DBNone extends AbstractDBAdapter
+public class NoneAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -40,8 +40,9 @@ public class DBNone extends AbstractDBAd
     /**
      * Empty protected constructor.
      */
-    protected DBNone()
+    protected NoneAdapter()
     {
+        // empty
     }
 
     /**
@@ -69,7 +70,7 @@ public class DBNone extends AbstractDBAd
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -78,7 +79,7 @@ public class DBNone extends AbstractDBAd
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object obj)
      */
     @Override
     public String getIDMethodSQL(Object obj)
@@ -96,6 +97,7 @@ public class DBNone extends AbstractDBAd
     @Override
     public void lockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 
     /**
@@ -108,5 +110,6 @@ public class DBNone extends AbstractDBAd
     @Override
     public void unlockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 }

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBOracle.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/OracleAdapter.java Fri Jun 29 03:38:08 2012
@@ -40,7 +40,7 @@ import org.apache.torque.util.UniqueList
  * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  * @version $Id$
  */
-public class DBOracle extends AbstractDBAdapter
+public class OracleAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -48,13 +48,14 @@ public class DBOracle extends AbstractDB
     private static final long serialVersionUID = 8966976210230241194L;
 
     /** The class logger. */
-    private static final Log log = LogFactory.getLog(DBOracle.class);
+    private static final Log log = LogFactory.getLog(OracleAdapter.class);
 
     /**
      * Empty constructor.
      */
-    protected DBOracle()
+    protected OracleAdapter()
     {
+        // empty
     }
 
     /**
@@ -82,7 +83,7 @@ public class DBOracle extends AbstractDB
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -101,7 +102,7 @@ public class DBOracle extends AbstractDB
      * @param sequenceName The name of the sequence (should be of type
      * <code>String</code>).
      * @return SQL to retreive the next database key.
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object)
      */
     @Override
     public String getIDMethodSQL(Object sequenceName)
@@ -158,7 +159,7 @@ public class DBOracle extends AbstractDB
 
     /**
      * Return true for Oracle
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeLimit()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeLimit()
      */
     @Override
     public boolean supportsNativeLimit()
@@ -168,7 +169,7 @@ public class DBOracle extends AbstractDB
 
     /**
      * Return true for Oracle
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeOffset()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeOffset()
      */
     @Override
     public boolean supportsNativeOffset()

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/PostgresAdapter.java (from r1348302, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/PostgresAdapter.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/PostgresAdapter.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java&r1=1348302&r2=1355228&rev=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBPostgres.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/PostgresAdapter.java Fri Jun 29 03:38:08 2012
@@ -33,7 +33,7 @@ import org.apache.torque.sql.Query;
  * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
  * @version $Id$
  */
-public class DBPostgres extends AbstractDBAdapter
+public class PostgresAdapter extends AbstractAdapter
 {
     /**
      * Serial version
@@ -43,8 +43,9 @@ public class DBPostgres extends Abstract
     /**
      * Empty constructor.
      */
-    protected DBPostgres()
+    protected PostgresAdapter()
     {
+        // empty
     }
 
     /**
@@ -74,7 +75,7 @@ public class DBPostgres extends Abstract
     }
 
     /**
-     * @see org.apache.torque.adapter.DB#getIDMethodType()
+     * @see org.apache.torque.adapter.Adapter#getIDMethodType()
      */
     @Override
     public IDMethod getIDMethodType()
@@ -86,7 +87,7 @@ public class DBPostgres extends Abstract
      * @param name The name of the field (should be of type
      *      <code>String</code>).
      * @return SQL to retreive the next database key.
-     * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object)
+     * @see org.apache.torque.adapter.Adapter#getIDMethodSQL(Object)
      */
     @Override
     public String getIDMethodSQL(Object name)
@@ -104,6 +105,7 @@ public class DBPostgres extends Abstract
     @Override
     public void lockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 
     /**
@@ -116,11 +118,12 @@ public class DBPostgres extends Abstract
     @Override
     public void unlockTable(Connection con, String table) throws SQLException
     {
+        // empty
     }
 
     /**
      * Return true for PostgreSQL
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeLimit()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeLimit()
      */
     @Override
     public boolean supportsNativeLimit()
@@ -130,7 +133,7 @@ public class DBPostgres extends Abstract
 
     /**
      * Return true for PostgreSQL
-     * @see org.apache.torque.adapter.AbstractDBAdapter#supportsNativeOffset()
+     * @see org.apache.torque.adapter.AbstractAdapter#supportsNativeOffset()
      */
     @Override
     public boolean supportsNativeOffset()

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=1355228&r1=1355227&r2=1355228&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 Fri Jun 29 03:38:08 2012
@@ -25,7 +25,7 @@ import java.util.Map;
 import org.apache.avalon.framework.component.Component;
 import org.apache.torque.Database;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.manager.AbstractBaseManager;
 import org.apache.torque.map.DatabaseMap;
 import org.apache.torque.om.Persistent;
@@ -146,8 +146,21 @@ public interface Torque
      * @return The corresponding database adapter.
      * @throws TorqueException Any exceptions caught during processing will be
      *         rethrown wrapped into a TorqueException.
+     * @deprecated use getAdapter(String) instead.
+     *             This method will be removed in a future version of Torque.
      */
-    DB getDB(String name) throws TorqueException;
+    @Deprecated
+    Adapter getDB(String name) throws TorqueException;
+
+    /**
+     * Returns database adapter for a specific connection pool.
+     *
+     * @param name A pool name.
+     * @return The corresponding database adapter.
+     * @throws TorqueException Any exceptions caught during processing will be
+     *         rethrown wrapped into a TorqueException.
+     */
+    Adapter getAdapter(String name) throws TorqueException;
 
     /**
      * Returns the name of the default database.

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java Fri Jun 29 03:38:08 2012
@@ -24,7 +24,7 @@ import java.sql.Connection;
 import java.util.List;
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.om.mapper.BigDecimalMapper;
 import org.apache.torque.om.mapper.IntegerMapper;
 import org.apache.torque.om.mapper.LongMapper;
@@ -44,7 +44,7 @@ import org.apache.torque.util.BasePeer;
 public class AutoIncrementIdGenerator implements IdGenerator
 {
     /** The adapter that knows the correct sql syntax */
-    private DB dbAdapter;
+    private final Adapter adapter;
 
     /**
      * The internal name of the Database that this Generator is connected to.
@@ -58,9 +58,9 @@ public class AutoIncrementIdGenerator im
      * @param databaseName The name of the databaseName to find the correct
      *        schema.
      */
-    public AutoIncrementIdGenerator(final DB dbAdapter, final String databaseName)
+    public AutoIncrementIdGenerator(final Adapter adapter, final String databaseName)
     {
-        this.dbAdapter = dbAdapter;
+        this.adapter = adapter;
         this.databaseName = databaseName;
     }
 
@@ -184,7 +184,7 @@ public class AutoIncrementIdGenerator im
         String tableName = SqlBuilder.getFullTableName(
                 String.valueOf(keyInfo),
                 databaseName);
-        String idSql = dbAdapter.getIDMethodSQL(tableName);
+        String idSql = adapter.getIDMethodSQL(tableName);
 
         List<T> result = BasePeer.doSelect(idSql, mapper, null, connection);
         return result.get(0);

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/IDGeneratorFactory.java Fri Jun 29 03:38:08 2012
@@ -19,7 +19,7 @@ package org.apache.torque.oid;
  * under the License.
  */
 
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.adapter.IDMethod;
 
 /**
@@ -55,23 +55,23 @@ public final class IDGeneratorFactory
      * Factory method which instantiates {@link
      * org.apache.torque.oid.IdGenerator} implementations based on the
      * return value of the provided adapter's {@link
-     * org.apache.torque.adapter.DB#getIDMethodType()} method.
+     * org.apache.torque.adapter.Adapter#getIDMethodType()} method.
      * Returns <code>null</code> for unknown types.
      *
-     * @param dbAdapter The type of adapter to create an ID generator for.
+     * @param adapter The type of adapter to create an ID generator for.
      *
      * @return The appropriate ID generator (possibly <code>null</code>).
      */
-    public static IdGenerator create(DB dbAdapter, String name)
+    public static IdGenerator create(Adapter adapter, String name)
     {
-        IDMethod idMethod = dbAdapter.getIDMethodType();
+        IDMethod idMethod = adapter.getIDMethodType();
         if (IDMethod.AUTO_INCREMENT == idMethod)
         {
-            return new AutoIncrementIdGenerator(dbAdapter, name);
+            return new AutoIncrementIdGenerator(adapter, name);
         }
         else if (IDMethod.SEQUENCE == idMethod)
         {
-            return new SequenceIdGenerator(dbAdapter, name);
+            return new SequenceIdGenerator(adapter, name);
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java Fri Jun 29 03:38:08 2012
@@ -24,7 +24,7 @@ import java.sql.Connection;
 import java.util.List;
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.om.mapper.BigDecimalMapper;
 import org.apache.torque.om.mapper.IntegerMapper;
 import org.apache.torque.om.mapper.LongMapper;
@@ -43,7 +43,7 @@ import org.apache.torque.util.BasePeer;
 public class SequenceIdGenerator implements IdGenerator
 {
     /** the adapter that knows the correct sql syntax */
-    private DB dbAdapter;
+    private final Adapter adapter;
 
     /** The internal name of the Database that this Generator is connected to */
     private String databaseName = null;
@@ -51,13 +51,13 @@ public class SequenceIdGenerator impleme
     /**
      * Creates an IdGenerator which will work with the specified database.
      *
-     * @param dbAdapter the adapter that knows the correct sql syntax.
+     * @param adapter the adapter that knows the correct sql syntax.
      * @param databaseName The name of the database to find the
      *        correct schema.
      */
-    public SequenceIdGenerator(final DB dbAdapter, final String databaseName)
+    public SequenceIdGenerator(final Adapter adapter, final String databaseName)
     {
-        this.dbAdapter = dbAdapter;
+        this.adapter = adapter;
         this.databaseName = databaseName;
     }
 
@@ -177,7 +177,7 @@ public class SequenceIdGenerator impleme
                 = SqlBuilder.getFullTableName(
                         String.valueOf(keyInfo),
                         databaseName);
-        String idSql = dbAdapter.getIDMethodSQL(sequenceName);
+        String idSql = adapter.getIDMethodSQL(sequenceName);
 
         List<T> result = BasePeer.doSelect(idSql, mapper, null, connection);
         return result.get(0);

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/SqlBuilder.java Fri Jun 29 03:38:08 2012
@@ -31,7 +31,7 @@ import org.apache.torque.ColumnImpl;
 import org.apache.torque.Database;
 import org.apache.torque.Torque;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.CriteriaInterface;
 import org.apache.torque.criteria.Criterion;
@@ -342,7 +342,7 @@ public final class SqlBuilder
     {
         final String dbName = criteria.getDbName();
         final Database database = Torque.getDatabase(dbName);
-        final DB db = Torque.getDB(dbName);
+        final Adapter adapter = Torque.getAdapter(dbName);
 
         boolean ignoreCase
                 = isIgnoreCase(criterion, criteria, database);
@@ -357,10 +357,12 @@ public final class SqlBuilder
         PreparedStatementPart whereClausePartOutput = null;
         for (WhereClausePsPartBuilder builder : whereClausePsPartBuilders)
         {
-            if (builder.isApplicable(whereClausePartInput, db))
+            if (builder.isApplicable(whereClausePartInput, adapter))
             {
-                whereClausePartOutput
-                        = builder.buildPs(whereClausePartInput, ignoreCase, db);
+                whereClausePartOutput = builder.buildPs(
+                        whereClausePartInput,
+                        ignoreCase,
+                        adapter);
                 break;
             }
         }
@@ -432,7 +434,7 @@ public final class SqlBuilder
         boolean ignoreCase
                 = criteria.isIgnoreCase() || criterion.isIgnoreCase();
         final String dbName = criteria.getDbName();
-        final DB db = Torque.getDB(dbName);
+        final Adapter adapter = Torque.getAdapter(dbName);
         final Database database = Torque.getDatabase(dbName);
         {
             Column databaseColumn = resolveAliasAndAsColumnAndSchema(
@@ -474,7 +476,7 @@ public final class SqlBuilder
             = buildPs(
                 whereClausePartInput,
                 ignoreCase,
-                db);
+                adapter);
         sb.append(whereClausePartOutput.getSql());
         query.getWhereClausePreparedStatementReplacements().addAll(
                 whereClausePartOutput.getPreparedStatementReplacements());
@@ -528,12 +530,12 @@ public final class SqlBuilder
             {
                 if (orderBy.isIgnoreCase() || crit.isIgnoreCase())
                 {
-                    final DB db = Torque.getDB(crit.getDbName());
+                    final Adapter adapter = Torque.getAdapter(crit.getDbName());
                     orderByClause.add(
-                            db.ignoreCaseInOrderBy(sqlExpression)
+                            adapter.ignoreCaseInOrderBy(sqlExpression)
                                 + ' ' + orderBy.getOrder());
                     selectClause.add(
-                            db.ignoreCaseInOrderBy(sqlExpression));
+                            adapter.ignoreCaseInOrderBy(sqlExpression));
                 }
                 else
                 {
@@ -645,8 +647,8 @@ public final class SqlBuilder
 
         if (offset > 0 || limit >= 0)
         {
-            DB db = Torque.getDB(crit.getDbName());
-            db.generateLimits(query, offset, limit);
+            Adapter adapter = Torque.getAdapter(crit.getDbName());
+            adapter.generateLimits(query, offset, limit);
         }
     }
 
@@ -1142,7 +1144,8 @@ public final class SqlBuilder
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @deprecated remove when util.Criteria is removed
      */
@@ -1150,7 +1153,7 @@ public final class SqlBuilder
     private static PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         PreparedStatementPart result = new PreparedStatementPart();
@@ -1241,14 +1244,14 @@ public final class SqlBuilder
             || whereClausePart.getOperator().equals(Criteria.ILIKE)
             || whereClausePart.getOperator().equals(Criteria.NOT_ILIKE))
         {
-            return buildPsLike(whereClausePart, ignoreCase, db);
+            return buildPsLike(whereClausePart, ignoreCase, adapter);
         }
 
         // handle IN and similar
         if (whereClausePart.getOperator().equals(Criteria.IN)
                 || whereClausePart.getOperator().equals(Criteria.NOT_IN))
         {
-            return buildPsIn(whereClausePart, ignoreCase, db);
+            return buildPsIn(whereClausePart, ignoreCase, adapter);
         }
 
         // Standard case
@@ -1258,9 +1261,9 @@ public final class SqlBuilder
             && whereClausePart.getRValue() instanceof String)
         {
             result.getSql().append(
-                    db.ignoreCase((String) whereClausePart.getLValue()))
+                    adapter.ignoreCase((String) whereClausePart.getLValue()))
                 .append(whereClausePart.getOperator())
-                .append(db.ignoreCase("?"));
+                .append(adapter.ignoreCase("?"));
         }
         else
         {
@@ -1288,7 +1291,8 @@ public final class SqlBuilder
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the rendered SQL for the WhereClauseExpression
      *
@@ -1298,7 +1302,7 @@ public final class SqlBuilder
     static PreparedStatementPart buildPsLike(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         if (!(whereClausePart.getRValue() instanceof String))
@@ -1363,7 +1367,7 @@ public final class SqlBuilder
 
         if (ignoreCase)
         {
-            if (db.useIlike() && !replaceWithEquals)
+            if (adapter.useIlike() && !replaceWithEquals)
             {
                 if (SqlEnum.LIKE.equals(whereClausePart.getOperator()))
                 {
@@ -1380,7 +1384,7 @@ public final class SqlBuilder
                 // or the LIKE was replaced with equals.
                 // need to ignore case manually.
                 whereClausePart.setLValue(
-                        db.ignoreCase((String) whereClausePart.getLValue()));
+                        adapter.ignoreCase((String) whereClausePart.getLValue()));
             }
         }
 
@@ -1425,12 +1429,12 @@ public final class SqlBuilder
 
         String rValueSql = "?";
         // handle ignoreCase if necessary
-        if (ignoreCase && (!(db.useIlike()) || replaceWithEquals))
+        if (ignoreCase && (!(adapter.useIlike()) || replaceWithEquals))
         {
-            rValueSql = db.ignoreCase(rValueSql);
+            rValueSql = adapter.ignoreCase(rValueSql);
         }
         // handle escape clause if necessary
-        if (!replaceWithEquals && db.useEscapeClauseForLike())
+        if (!replaceWithEquals && adapter.useEscapeClauseForLike())
         {
             rValueSql = rValueSql + SqlEnum.ESCAPE + "'\\'";
         }
@@ -1450,7 +1454,8 @@ public final class SqlBuilder
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the built part.
      *
@@ -1460,7 +1465,7 @@ public final class SqlBuilder
     static PreparedStatementPart buildPsIn(
             WhereClauseExpression whereClausePart,
             boolean ignoreCase,
-            DB db)
+            Adapter adapter)
     {
         PreparedStatementPart result = new PreparedStatementPart();
 
@@ -1479,7 +1484,7 @@ public final class SqlBuilder
                 result.getPreparedStatementReplacements().add(listValue);
                 if (ignoreCase && listValue instanceof String)
                 {
-                    inClause.add(db.ignoreCase("?"));
+                    inClause.add(adapter.ignoreCase("?"));
                     ignoreCaseApplied = true;
                 }
                 else
@@ -1500,7 +1505,7 @@ public final class SqlBuilder
                 result.getPreparedStatementReplacements().add(arrayValue);
                 if (ignoreCase && arrayValue instanceof String)
                 {
-                    inClause.add(db.ignoreCase("?"));
+                    inClause.add(adapter.ignoreCase("?"));
                     ignoreCaseApplied = true;
                 }
                 else
@@ -1526,7 +1531,7 @@ public final class SqlBuilder
         if (ignoreCaseApplied)
         {
             result.getSql().append(
-                    db.ignoreCase((String) whereClausePart.getLValue()));
+                    adapter.ignoreCase((String) whereClausePart.getLValue()));
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectOrColumnPsPartBuilder.java Fri Jun 29 03:38:08 2012
@@ -21,7 +21,7 @@ package org.apache.torque.sql.objectbuil
 
 import org.apache.torque.Column;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.criteria.SqlEnum;
@@ -43,7 +43,8 @@ public class ObjectOrColumnPsPartBuilder
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the PreparedStatementPart for the object.
      *
@@ -52,7 +53,7 @@ public class ObjectOrColumnPsPartBuilder
     public PreparedStatementPart buildPs(
             Object toBuildFrom,
             boolean ignoreCase,
-            DB db)
+            Adapter adapter)
         throws TorqueException
     {
         PreparedStatementPart result = new PreparedStatementPart();
@@ -62,7 +63,7 @@ public class ObjectOrColumnPsPartBuilder
             if (ignoreCase)
             {
                 result.getSql().append(
-                        db.ignoreCase(column.getSqlExpression()));
+                        adapter.ignoreCase(column.getSqlExpression()));
             }
             else
             {
@@ -112,7 +113,7 @@ public class ObjectOrColumnPsPartBuilder
         // handle ignoreCase
         if (ignoreCase && toBuildFrom instanceof String)
         {
-            result.getSql().append(db.ignoreCase("?"));
+            result.getSql().append(adapter.ignoreCase("?"));
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectPsPartBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectPsPartBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectPsPartBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/objectbuilder/ObjectPsPartBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.objectbuil
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 
 /**
@@ -38,7 +38,8 @@ public interface ObjectPsPartBuilder
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the PreparedStatementPart for the object.
      *
@@ -47,6 +48,6 @@ public interface ObjectPsPartBuilder
     PreparedStatementPart buildPs(
             Object toBuildFrom,
             boolean ignoreCase,
-            DB db)
+            Adapter adapter)
         throws TorqueException;
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CurrentDateTimePsPartBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CurrentDateTimePsPartBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CurrentDateTimePsPartBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CurrentDateTimePsPartBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.whereclaus
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.criteria.SqlEnum;
 import org.apache.torque.sql.WhereClauseExpression;
@@ -40,19 +40,19 @@ public class CurrentDateTimePsPartBuilde
     public PreparedStatementPart buildPs(
             WhereClauseExpression whereClauseExpression,
             boolean ignoreCase,
-            DB db)
+            Adapter adapter)
         throws TorqueException
     {
         PreparedStatementPart result
             = objectOrColumnPsPartBuilder.buildPs(
                     whereClauseExpression.getLValue(),
                     ignoreCase,
-                    db);
+                    adapter);
         result.getSql().append(whereClauseExpression.getOperator());
         result .append(objectOrColumnPsPartBuilder.buildPs(
                 whereClauseExpression.getRValue(),
                 ignoreCase,
-                db));
+                adapter));
         return result;
     }
 
@@ -61,7 +61,7 @@ public class CurrentDateTimePsPartBuilde
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         if (whereClauseExpression.getOperator().equals(
                         SqlEnum.CURRENT_DATE)

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CustomBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CustomBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CustomBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/CustomBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.whereclaus
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.criteria.SqlEnum;
 import org.apache.torque.sql.WhereClauseExpression;
@@ -44,14 +44,15 @@ public class CustomBuilder implements Wh
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the rendered SQL for the WhereClauseExpression
      */
     public PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         if (!(whereClausePart.getRValue() instanceof String))
@@ -70,13 +71,14 @@ public class CustomBuilder implements Wh
      * a given WhereClauseExpression.
      *
      * @param whereClauseExpression the WhereClauseExpression in question.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return true if applicable, false otherwise.
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         if (whereClauseExpression.getOperator().equals(SqlEnum.CUSTOM))
         {

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/InBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/InBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/InBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/InBuilder.java Fri Jun 29 03:38:08 2012
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.Criterion;
 import org.apache.torque.criteria.PreparedStatementPart;
@@ -49,12 +49,13 @@ public class InBuilder extends AbstractW
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      */
     public PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         PreparedStatementPart result = new PreparedStatementPart();
@@ -74,7 +75,7 @@ public class InBuilder extends AbstractW
                 result.getPreparedStatementReplacements().add(listValue);
                 if (ignoreCase && listValue instanceof String)
                 {
-                    inClause.add(db.ignoreCase("?"));
+                    inClause.add(adapter.ignoreCase("?"));
                     ignoreCaseApplied = true;
                 }
                 else
@@ -95,7 +96,7 @@ public class InBuilder extends AbstractW
                 result.getPreparedStatementReplacements().add(arrayValue);
                 if (ignoreCase && arrayValue instanceof String)
                 {
-                    inClause.add(db.ignoreCase("?"));
+                    inClause.add(adapter.ignoreCase("?"));
                     ignoreCaseApplied = true;
                 }
                 else
@@ -121,7 +122,7 @@ public class InBuilder extends AbstractW
         result.append(objectOrColumnPsPartBuilder.buildPs(
                 whereClausePart.getLValue(),
                 ignoreCaseApplied,
-                db));
+                adapter));
 
         result.getSql().append(whereClausePart.getOperator())
                 .append('(')
@@ -135,7 +136,7 @@ public class InBuilder extends AbstractW
                 result.append(objectOrColumnPsPartBuilder.buildPs(
                         whereClausePart.getLValue(),
                         false,
-                        db));
+                        adapter));
                 result.getSql().append(SqlEnum.ISNULL);
             }
             else if (whereClausePart.getOperator() == SqlEnum.NOT_IN)
@@ -144,7 +145,7 @@ public class InBuilder extends AbstractW
                 result.append(objectOrColumnPsPartBuilder.buildPs(
                         whereClausePart.getLValue(),
                         false,
-                        db));
+                        adapter));
                 result.getSql().append(SqlEnum.ISNOTNULL);
             }
             result.getSql().append(')');
@@ -157,7 +158,7 @@ public class InBuilder extends AbstractW
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         if (whereClauseExpression.getOperator().equals(Criteria.IN)
                 || whereClauseExpression.getOperator().equals(Criteria.NOT_IN))

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/LikeBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/LikeBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/LikeBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/LikeBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.whereclaus
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.criteria.SqlEnum;
 import org.apache.torque.sql.WhereClauseExpression;
@@ -51,14 +51,15 @@ public class LikeBuilder extends Abstrac
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the rendered SQL for the WhereClauseExpression
      */
     public PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         if (!(whereClausePart.getRValue() instanceof String))
@@ -124,7 +125,7 @@ public class LikeBuilder extends Abstrac
         PreparedStatementPart result;
         if (ignoreCase)
         {
-            if (db.useIlike() && !replaceWithEquals)
+            if (adapter.useIlike() && !replaceWithEquals)
             {
                 if (SqlEnum.LIKE.equals(whereClausePart.getOperator()))
                 {
@@ -135,7 +136,7 @@ public class LikeBuilder extends Abstrac
                     whereClausePart.setOperator(SqlEnum.NOT_ILIKE);
                 }
                 result = objectOrColumnPsPartBuilder.buildPs(
-                        whereClausePart.getLValue(), false, db);
+                        whereClausePart.getLValue(), false, adapter);
             }
             else
             {
@@ -143,13 +144,13 @@ public class LikeBuilder extends Abstrac
                 // or the LIKE was replaced with equals.
                 // need to ignore case manually.
                 result = objectOrColumnPsPartBuilder.buildPs(
-                        whereClausePart.getLValue(), true, db);
+                        whereClausePart.getLValue(), true, adapter);
             }
         }
         else
         {
             result = objectOrColumnPsPartBuilder.buildPs(
-                    whereClausePart.getLValue(), ignoreCase, db);
+                    whereClausePart.getLValue(), ignoreCase, adapter);
         }
 
         if (replaceWithEquals)
@@ -190,12 +191,12 @@ public class LikeBuilder extends Abstrac
 
         String rValueSql = "?";
         // handle ignoreCase if necessary
-        if (ignoreCase && (!(db.useIlike()) || replaceWithEquals))
+        if (ignoreCase && (!(adapter.useIlike()) || replaceWithEquals))
         {
-            rValueSql = db.ignoreCase(rValueSql);
+            rValueSql = adapter.ignoreCase(rValueSql);
         }
         // handle escape clause if necessary
-        if (!replaceWithEquals && db.useEscapeClauseForLike())
+        if (!replaceWithEquals && adapter.useEscapeClauseForLike())
         {
             rValueSql = rValueSql + SqlEnum.ESCAPE + "'\\'";
         }
@@ -210,7 +211,7 @@ public class LikeBuilder extends Abstrac
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         if (whereClauseExpression.getOperator().equals(SqlEnum.LIKE)
             || whereClauseExpression.getOperator().equals(SqlEnum.NOT_LIKE)

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/NullValueBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/NullValueBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/NullValueBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/NullValueBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.whereclaus
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.criteria.SqlEnum;
 import org.apache.torque.sql.WhereClauseExpression;
@@ -44,14 +44,15 @@ public class NullValueBuilder extends Ab
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the rendered SQL for the WhereClauseExpression
      */
     public PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter adapter)
             throws TorqueException
     {
         PreparedStatementPart result;
@@ -59,7 +60,7 @@ public class NullValueBuilder extends Ab
             || whereClausePart.getOperator().equals(SqlEnum.ISNOTNULL))
         {
             result = objectOrColumnPsPartBuilder.buildPs(
-                    whereClausePart.getLValue(), ignoreCase, db);
+                    whereClausePart.getLValue(), ignoreCase, adapter);
             result.getSql().append(whereClausePart.getOperator());
             return result;
         }
@@ -68,7 +69,7 @@ public class NullValueBuilder extends Ab
         if (whereClausePart.getOperator().equals(SqlEnum.EQUAL))
         {
             result = objectOrColumnPsPartBuilder.buildPs(
-                    whereClausePart.getLValue(), ignoreCase, db);
+                    whereClausePart.getLValue(), ignoreCase, adapter);
             result.getSql().append(SqlEnum.ISNULL);
             return result;
         }
@@ -77,7 +78,7 @@ public class NullValueBuilder extends Ab
                     SqlEnum.ALT_NOT_EQUAL))
         {
             result = objectOrColumnPsPartBuilder.buildPs(
-                    whereClausePart.getLValue(), ignoreCase, db);
+                    whereClausePart.getLValue(), ignoreCase, adapter);
             result.getSql().append(SqlEnum.ISNOTNULL);
             return result;
         }
@@ -90,13 +91,14 @@ public class NullValueBuilder extends Ab
      * a given WhereClauseExpression.
      *
      * @param whereClauseExpression the WhereClauseExpression in question.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return true if applicable, false otherwise.
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         if (whereClauseExpression.getOperator().equals(SqlEnum.ISNULL)
             || whereClauseExpression.getOperator().equals(SqlEnum.ISNOTNULL))

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/StandardBuilder.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/StandardBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/StandardBuilder.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/StandardBuilder.java Fri Jun 29 03:38:08 2012
@@ -20,7 +20,7 @@ package org.apache.torque.sql.whereclaus
  */
 
 import org.apache.torque.TorqueException;
-import org.apache.torque.adapter.DB;
+import org.apache.torque.adapter.Adapter;
 import org.apache.torque.criteria.PreparedStatementPart;
 import org.apache.torque.sql.WhereClauseExpression;
 
@@ -41,14 +41,15 @@ public class StandardBuilder extends Abs
      * @param ignoreCase If true and columns represent Strings, the appropriate
      *        function defined for the database will be used to ignore
      *        differences in case.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return the rendered SQL for the WhereClauseExpression
      */
     public PreparedStatementPart buildPs(
                 WhereClauseExpression whereClausePart,
                 boolean ignoreCase,
-                DB db)
+                Adapter db)
             throws TorqueException
     {
         PreparedStatementPart result = objectOrColumnPsPartBuilder.buildPs(
@@ -64,13 +65,14 @@ public class StandardBuilder extends Abs
      * a given WhereClauseExpression.
      *
      * @param whereClauseExpression the WhereClauseExpression in question.
-     * @param db The database for which the SQL should be created, not null.
+     * @param adapter The adapter for the database for which the SQL
+     *        should be created, not null.
      *
      * @return true if applicable, false otherwise.
      */
     public boolean isApplicable(
             WhereClauseExpression whereClauseExpression,
-            DB db)
+            Adapter adapter)
     {
         return true;
     }



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