Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/VerbatimSqlConditionBuilder.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/VerbatimSqlConditionBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/VerbatimSqlConditionBuilder.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/VerbatimSqlConditionBuilder.java Fri Jun 29 03:38:08 2012 @@ -22,7 +22,7 @@ package org.apache.torque.sql.whereclaus import java.util.Arrays; 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 VerbatimSqlConditionBuilder * @param whereClausePart the part of the where clause to build. * Can be modified in this method. * @param ignoreCase is ignored here. - * @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 = new PreparedStatementPart(); @@ -68,13 +69,14 @@ public class VerbatimSqlConditionBuilder * 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.isVerbatimSqlCondition()) {
Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/WhereClausePsPartBuilder.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/WhereClausePsPartBuilder.java?rev=1355228&r1=1355227&r2=1355228&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/WhereClausePsPartBuilder.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/sql/whereclausebuilder/WhereClausePsPartBuilder.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; @@ -39,7 +39,8 @@ public interface WhereClausePsPartBuilde * @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 WhereClauseExpression. * @@ -48,7 +49,7 @@ public interface WhereClausePsPartBuilde PreparedStatementPart buildPs( WhereClauseExpression whereClauseExpression, boolean ignoreCase, - DB db) + Adapter adapter) throws TorqueException; /** @@ -56,9 +57,12 @@ public interface WhereClausePsPartBuilde * 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. */ - boolean isApplicable(WhereClauseExpression whereClauseExpression, DB db); + boolean isApplicable( + WhereClauseExpression whereClauseExpression, + Adapter adapter); } Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1355228&r1=1355227&r2=1355228&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java Fri Jun 29 03:38:08 2012 @@ -39,7 +39,7 @@ import org.apache.torque.Database; import org.apache.torque.TooManyRowsException; 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.adapter.IDMethod; import org.apache.torque.criteria.FromElement; import org.apache.torque.map.ColumnMap; @@ -846,15 +846,15 @@ public class BasePeerImpl implements Ser { String databaseName = tableMap.getDatabaseMap().getDatabase().getName(); - DB dbAdapter = Torque.getDB(databaseName); - if (dbAdapter == null) + Adapter adapter = Torque.getAdapter(databaseName); + if (adapter == null) { throw new TorqueException( "missing adapter configuration for database " + databaseName + "check the Torque configuration"); } - idMethod = dbAdapter.getIDMethodType(); + idMethod = adapter.getIDMethodType(); } Object keyInfo = tableMap.getPrimaryKeyMethodInfo(idMethod); return keyInfo; Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/TorqueInstanceTest.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/TorqueInstanceTest.java?rev=1355228&r1=1355227&r2=1355228&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/TorqueInstanceTest.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/TorqueInstanceTest.java Fri Jun 29 03:38:08 2012 @@ -21,8 +21,8 @@ package org.apache.torque; import java.util.Map; -import org.apache.torque.adapter.DB; -import org.apache.torque.adapter.DBPostgres; +import org.apache.torque.adapter.Adapter; +import org.apache.torque.adapter.PostgresAdapter; import org.apache.torque.dsfactory.DataSourceFactory; /** @@ -51,9 +51,9 @@ public class TorqueInstanceTest extends */ public void testExternalAdapter() throws Exception { - DB adapter = Torque.getDatabase(POSTGRESQL_NAME).getAdapter(); + Adapter adapter = Torque.getDatabase(POSTGRESQL_NAME).getAdapter(); assertNotNull(adapter); - assertTrue(adapter instanceof DBPostgres); + assertTrue(adapter instanceof PostgresAdapter); } /** Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/adapter/DBOracleTest.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/adapter/DBOracleTest.java?rev=1355228&r1=1355227&r2=1355228&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/adapter/DBOracleTest.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/adapter/DBOracleTest.java Fri Jun 29 03:38:08 2012 @@ -42,14 +42,14 @@ public class DBOracleTest extends TestCa // A list with no duplicates must remain unchanged Query query = new Query(); query.getSelectClause().addAll(input); - new DBOracle().generateLimits(query, 0, 1); + new OracleAdapter().generateLimits(query, 0, 1); assertEquals(input, query.getSelectClause()); // double column names must be aliased query = new Query(); input.set(1, "t.c1"); query.getSelectClause().addAll(input); - new DBOracle().generateLimits(query, 0, 1); + new OracleAdapter().generateLimits(query, 0, 1); UniqueList expected = new UniqueList(input); expected.set(1, "t.c1 a0"); assertEquals(expected, query.getSelectClause()); @@ -59,7 +59,7 @@ public class DBOracleTest extends TestCa input.set(1, "c2"); input.set(0, "t.a1"); query.getSelectClause().addAll(input); - new DBOracle().generateLimits(query, 0, 1); + new OracleAdapter().generateLimits(query, 0, 1); expected = new UniqueList(input); expected.set(0, "t.a1 a0"); assertEquals(query.getSelectClause(), expected); @@ -68,7 +68,7 @@ public class DBOracleTest extends TestCa query = new Query(); input.set(1, "t2.a1"); query.getSelectClause().addAll(input); - new DBOracle().generateLimits(query, 0, 1); + new OracleAdapter().generateLimits(query, 0, 1); expected = new UniqueList(input); expected.set(0, "t.a1 a0"); expected.set(1, "t2.a1 a3"); --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org For additional commands, e-mail: torque-dev-h...@db.apache.org