Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C41666C90 for ; Fri, 15 Jul 2011 19:16:25 +0000 (UTC) Received: (qmail 14717 invoked by uid 500); 15 Jul 2011 19:16:25 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 14675 invoked by uid 500); 15 Jul 2011 19:16:25 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 14662 invoked by uid 500); 15 Jul 2011 19:16:24 -0000 Received: (qmail 14464 invoked by uid 99); 15 Jul 2011 19:16:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 19:16:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 19:16:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 31DEB238890D; Fri, 15 Jul 2011 19:16:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1147286 - in /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque: sql/SqlBuilder.java util/Criteria.java Date: Fri, 15 Jul 2011 19:16:03 -0000 To: torque-commits@db.apache.org From: tfischer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110715191603.31DEB238890D@eris.apache.org> Author: tfischer Date: Fri Jul 15 19:16:02 2011 New Revision: 1147286 URL: http://svn.apache.org/viewvc?rev=1147286&view=rev Log: TORQUE-167: remove the field db from Criteria.Criterion Modified: 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/util/Criteria.java 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=1147286&r1=1147285&r2=1147286&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 Jul 15 19:16:02 2011 @@ -387,7 +387,6 @@ public final class SqlBuilder Query query) throws TorqueException { - criterion.setDB(db); String tableName = criterion.getTable(); if (tableName != null) @@ -439,7 +438,7 @@ public final class SqlBuilder = buildPs( whereClausePartInput, ignoreCase, - criterion.getDb()); + db); sb.append(whereClausePartOutput.getSql()); query.getPreparedStatementReplacements().addAll( whereClausePartOutput.getPreparedStatementReplacements()); Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java?rev=1147286&r1=1147285&r2=1147286&view=diff ============================================================================== --- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java (original) +++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java Fri Jul 15 19:16:02 2011 @@ -38,7 +38,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.torque.Torque; import org.apache.torque.TorqueException; -import org.apache.torque.adapter.DB; import org.apache.torque.om.ObjectKey; /** @@ -3068,12 +3067,6 @@ public class Criteria implements Seriali private boolean ignoreStringCase = false; /** - * The DB adaptor which might be used to get db specific - * variations of sql. - */ - private DB db; - - /** * other connected criteria. */ private List clauses = new ArrayList(); @@ -3234,53 +3227,6 @@ public class Criteria implements Seriali } /** - * Get the value of db. - * The DB adaptor which might be used to get db specific - * variations of sql. - * @return value of db. - */ - public DB getDb() - { - if (this.db == null) - { - // db may not be set if generating preliminary sql for - // debugging. - try - { - return Torque.getDB(getDbName()); - } - catch (Exception e) - { - // we are only doing this to allow easier debugging, so - // no need to throw up the exception, just make note of it. - log.error( - "Could not get a DB adapter, so sql may be wrong"); - return null; - } - } - else - { - return this.db; - } - } - - /** - * Set the value of db. - * The DB adaptor might be used to get db specific - * variations of sql. - * @param v Value to assign to db. - */ - public void setDB(DB v) - { - this.db = v; - - for (int i = 0; i < this.clauses.size(); i++) - { - ((clauses.get(i))).setDB(v); - } - } - - /** * Sets ignore case. * * @param b True if case should be ignored. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org