cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1144723 [1/2] - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/dba/ main/java/org/apache/cayenne/dba/db2/ m...
Date Sat, 09 Jul 2011 19:50:57 GMT
Author: aadamchik
Date: Sat Jul  9 19:50:55 2011
New Revision: 1144723

URL: http://svn.apache.org/viewvc?rev=1144723&view=rev
Log:
CAY-1573 QueryLogger to DI JdbcEventLogger migration

patch by Dzmitry Kazimirchyk - ql-adapters.patch

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/ProcedureTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2PkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBasePkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OraclePkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresPkGenerator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/merge/ExecutingMergerContext.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbGeneratorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/TransactionThreadTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/UserTransactionTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/BindDirectiveTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/jdbc/ResultDirectiveTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java Sat Jul  9 19:50:55 2011
@@ -26,8 +26,8 @@ import java.util.List;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.QueryMetadata;
@@ -42,10 +42,12 @@ public abstract class BaseSQLAction impl
 
     protected JdbcAdapter adapter;
     protected EntityResolver entityResolver;
+    protected JdbcEventLogger logger;
 
     public BaseSQLAction(JdbcAdapter adapter, EntityResolver entityResolver) {
         this.adapter = adapter;
         this.entityResolver = entityResolver;
+        this.logger = adapter.getJdbcEventLogger();
     }
 
     public JdbcAdapter getAdapter() {
@@ -83,8 +85,7 @@ public abstract class BaseSQLAction impl
 
         if (!delegate.isIteratedResult()) {
             List<DataRow> resultRows = (List<DataRow>) it.allRows();
-            QueryLogger
-                    .logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
+            logger.logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
 
             delegate.nextRows(query, resultRows);
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java Sat Jul  9 19:50:55 2011
@@ -31,7 +31,6 @@ import java.util.Map;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.OptimisticLockException;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.access.trans.BatchQueryBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -114,10 +113,10 @@ public class BatchAction extends BaseSQL
             OperationObserver delegate) throws SQLException, Exception {
 
         String queryStr = queryBuilder.createSqlString(query);
-        boolean isLoggable = QueryLogger.isLoggable();
+        boolean isLoggable = logger.isLoggable();
 
         // log batch SQL execution
-        QueryLogger.logQuery(queryStr, Collections.EMPTY_LIST);
+        logger.logQuery(queryStr, Collections.EMPTY_LIST);
 
         // run batch
         query.reset();
@@ -127,7 +126,7 @@ public class BatchAction extends BaseSQL
             while (query.next()) {
 
                 if (isLoggable) {
-                    QueryLogger.logQueryParameters(
+                    logger.logQueryParameters(
                             "batch bind",
                             query.getDbAttributes(),
                             queryBuilder.getParameterValues(query),
@@ -155,7 +154,7 @@ public class BatchAction extends BaseSQL
                     totalUpdateCount += result;
                 }
 
-                QueryLogger.logUpdateCount(totalUpdateCount);
+                logger.logUpdateCount(totalUpdateCount);
             }
         }
         finally {
@@ -176,13 +175,13 @@ public class BatchAction extends BaseSQL
             OperationObserver delegate,
             boolean generatesKeys) throws SQLException, Exception {
 
-        boolean isLoggable = QueryLogger.isLoggable();
+        boolean isLoggable = logger.isLoggable();
         boolean useOptimisticLock = query.isUsingOptimisticLocking();
 
         String queryStr = queryBuilder.createSqlString(query);
 
         // log batch SQL execution
-        QueryLogger.logQuery(queryStr, Collections.EMPTY_LIST);
+        logger.logQuery(queryStr, Collections.EMPTY_LIST);
 
         // run batch queries one by one
         query.reset();
@@ -193,7 +192,7 @@ public class BatchAction extends BaseSQL
         try {
             while (query.next()) {
                 if (isLoggable) {
-                    QueryLogger.logQueryParameters(
+                    logger.logQueryParameters(
                             "bind",
                             query.getDbAttributes(),
                             queryBuilder.getParameterValues(query),
@@ -226,7 +225,7 @@ public class BatchAction extends BaseSQL
                 }
 
                 if (isLoggable) {
-                    QueryLogger.logUpdateCount(updated);
+                    logger.logUpdateCount(updated);
                 }
             }
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java Sat Jul  9 19:50:55 2011
@@ -29,7 +29,6 @@ import java.util.List;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -109,7 +108,7 @@ public class ProcedureAction extends Bas
                     if (updateCount == -1) {
                         break;
                     }
-                    QueryLogger.logUpdateCount(updateCount);
+                    logger.logUpdateCount(updateCount);
                     observer.nextCount(query, updateCount);
                 }
             }
@@ -135,6 +134,7 @@ public class ProcedureAction extends Bas
         translator.setQuery(query);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 
@@ -226,7 +226,7 @@ public class ProcedureAction extends Bas
 
         if (result != null && !result.isEmpty()) {
             // treat out parameters as a separate data row set
-            QueryLogger.logSelectCount(1, System.currentTimeMillis() - t1);
+            logger.logSelectCount(1, System.currentTimeMillis() - t1);
             delegate.nextRows(query, Collections.singletonList(result));
         }
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java Sat Jul  9 19:50:55 2011
@@ -35,10 +35,11 @@ import java.util.Map;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.TypesMapping;
+import org.apache.cayenne.log.JdbcEventLogger;
+import org.apache.cayenne.log.NoopJdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.EntityResolver;
@@ -62,6 +63,7 @@ public class SQLTemplateAction implement
     protected QueryMetadata queryMetadata;
 
     protected DbEntity dbEntity;
+    protected JdbcEventLogger logger;
 
     /**
      * @since 3.0
@@ -72,6 +74,7 @@ public class SQLTemplateAction implement
         this.adapter = adapter;
         this.queryMetadata = query.getMetaData(entityResolver);
         this.dbEntity = query.getMetaData(entityResolver).getDbEntity();
+        this.logger = NoopJdbcEventLogger.getInstance();
     }
 
     /**
@@ -80,6 +83,14 @@ public class SQLTemplateAction implement
     public DbAdapter getAdapter() {
         return adapter;
     }
+    
+    public void setJdbcEventLogger(JdbcEventLogger logger) {
+        this.logger = logger;
+    }
+    
+    public JdbcEventLogger getJdbcEventLogger() {
+        return this.logger;
+    }
 
     /**
      * Runs a SQLTemplate query, collecting all results. If a callback expects an iterated
@@ -96,7 +107,7 @@ public class SQLTemplateAction implement
                     + getAdapter().getClass().getName());
         }
 
-        boolean loggable = QueryLogger.isLoggable();
+        boolean loggable = getJdbcEventLogger().isLoggable();
         int size = query.parametersSize();
 
         SQLTemplateProcessor templateProcessor = new SQLTemplateProcessor();
@@ -116,7 +127,7 @@ public class SQLTemplateAction implement
                     nextParameters);
 
             if (loggable) {
-                QueryLogger.logQuery(compiled.getSql(), Arrays.asList(compiled
+                getJdbcEventLogger().logQuery(compiled.getSql(), Arrays.asList(compiled
                         .getBindings()));
             }
 
@@ -192,7 +203,7 @@ public class SQLTemplateAction implement
                     }
 
                     updateCounts.add(Integer.valueOf(updateCount));
-                    QueryLogger.logUpdateCount(updateCount);
+                    getJdbcEventLogger().logUpdateCount(updateCount);
                 }
             }
         }
@@ -234,7 +245,7 @@ public class SQLTemplateAction implement
             // is due here.
             List<DataRow> resultRows = (List<DataRow>) it.allRows();
 
-            QueryLogger.logSelectCount(resultRows.size(), System.currentTimeMillis()
+            getJdbcEventLogger().logSelectCount(resultRows.size(), System.currentTimeMillis()
                     - startTime);
 
             callback.nextRows(query, resultRows);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java Sat Jul  9 19:50:55 2011
@@ -27,7 +27,6 @@ import java.util.List;
 
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -58,9 +57,10 @@ public class SelectAction extends BaseSQ
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
-
+    
     public void performAction(Connection connection, OperationObserver observer)
             throws SQLException, Exception {
 
@@ -167,8 +167,7 @@ public class SelectAction extends BaseSQ
                 it.close();
             }
 
-            QueryLogger
-                    .logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
+            logger.logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
 
             observer.nextRows(query, resultRows);
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/ProcedureTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/ProcedureTranslator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/ProcedureTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/ProcedureTranslator.java Sat Jul  9 19:50:55 2011
@@ -26,8 +26,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.log.JdbcEventLogger;
+import org.apache.cayenne.log.NoopJdbcEventLogger;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.Procedure;
 import org.apache.cayenne.map.ProcedureParameter;
@@ -54,6 +55,7 @@ public class ProcedureTranslator {
             return type;
         }
     }
+    
 
     private static NotInParam OUT_PARAM = new NotInParam("[OUT]");
 
@@ -63,6 +65,11 @@ public class ProcedureTranslator {
     protected EntityResolver entityResolver;
     protected List<ProcedureParameter> callParams;
     protected List<Object> values;
+    protected JdbcEventLogger logger;
+    
+    public ProcedureTranslator() {
+        this.logger = NoopJdbcEventLogger.getInstance();
+    }
 
     public void setQuery(ProcedureQuery query) {
         this.query = query;
@@ -75,6 +82,17 @@ public class ProcedureTranslator {
     public void setAdapter(DbAdapter adapter) {
         this.adapter = adapter;
     }
+    
+    /**
+     * @since 3.1
+     */
+    public void setJdbcEventLogger(JdbcEventLogger logger) {
+        this.logger = logger;
+    }
+    
+    public JdbcEventLogger getJdbcEventLogger() {
+        return logger;
+    }
 
     /**
      * @since 1.2
@@ -131,7 +149,7 @@ public class ProcedureTranslator {
         initValues();
         String sqlStr = createSqlString();
 
-        if (QueryLogger.isLoggable()) {
+        if (getJdbcEventLogger().isLoggable()) {
             // need to convert OUT/VOID parameters to loggable strings
             long time = System.currentTimeMillis() - t1;
 
@@ -144,7 +162,7 @@ public class ProcedureTranslator {
             }
 
             // FIXME: compute proper attributes via callParams
-            QueryLogger.logQuery(sqlStr, null, loggableParameters, time);
+            getJdbcEventLogger().logQuery(sqlStr, null, loggableParameters, time);
         }
         CallableStatement stmt = connection.prepareCall(sqlStr);
         initStatement(stmt);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/QueryAssembler.java Sat Jul  9 19:50:55 2011
@@ -25,8 +25,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.log.JdbcEventLogger;
+import org.apache.cayenne.log.NoopJdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
@@ -46,6 +47,7 @@ public abstract class QueryAssembler {
     protected Connection connection;
     protected DbAdapter adapter;
     protected EntityResolver entityResolver;
+    protected JdbcEventLogger logger;
 
     /**
      * Holds PreparedStatement values.
@@ -61,6 +63,10 @@ public abstract class QueryAssembler {
      * The index parameter will be inserted at in parameter list
      */
     protected int parameterIndex;
+    
+    public QueryAssembler() {
+        this.logger = NoopJdbcEventLogger.getInstance();
+    }
 
     /**
      * Returns aliases for the path splits defined in the query.
@@ -102,6 +108,14 @@ public abstract class QueryAssembler {
     public void setAdapter(DbAdapter adapter) {
         this.adapter = adapter;
     }
+    
+    public void setJdbcEventLogger(JdbcEventLogger logger) {
+        this.logger = logger;
+    }
+    
+    public JdbcEventLogger getJdbcEventLogger() {
+        return logger;
+    }
 
     public void setEntityResolver(EntityResolver entityResolver) {
         this.entityResolver = entityResolver;
@@ -182,7 +196,7 @@ public abstract class QueryAssembler {
     public PreparedStatement createStatement() throws Exception {
         long t1 = System.currentTimeMillis();
         String sqlStr = createSqlString();
-        QueryLogger.logQuery(sqlStr, attributes, values, System.currentTimeMillis() - t1);
+        getJdbcEventLogger().logQuery(sqlStr, attributes, values, System.currentTimeMillis() - t1);
         PreparedStatement stmt = connection.prepareStatement(sqlStr);
         initStatement(stmt);
         return stmt;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -24,6 +24,7 @@ import org.apache.cayenne.access.jdbc.EJ
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.access.jdbc.SelectAction;
+import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.BatchQuery;
 import org.apache.cayenne.query.EJBQLQuery;
@@ -43,10 +44,12 @@ public class JdbcActionBuilder implement
 
     protected JdbcAdapter adapter;
     protected EntityResolver entityResolver;
+    protected JdbcEventLogger logger;
 
     public JdbcActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         this.adapter = adapter;
         this.entityResolver = resolver;
+        this.logger = adapter.getJdbcEventLogger();
     }
 
     public SQLAction batchAction(BatchQuery query) {
@@ -70,7 +73,9 @@ public class JdbcActionBuilder implement
     }
 
     public SQLAction sqlAction(SQLTemplate query) {
-        return new SQLTemplateAction(query, adapter, entityResolver);
+        SQLTemplateAction action = new SQLTemplateAction(query, adapter, entityResolver);
+        action.setJdbcEventLogger(logger);
+        return action;
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java Sat Jul  9 19:50:55 2011
@@ -37,6 +37,7 @@ import org.apache.cayenne.access.trans.Q
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;
@@ -58,7 +59,8 @@ public class JdbcAdapter implements DbAd
     final static String DEFAULT_IDENTIFIERS_START_QUOTE = "\"";
     final static String DEFAULT_IDENTIFIERS_END_QUOTE = "\"";
 
-    protected PkGenerator pkGenerator;
+    private PkGenerator pkGenerator;
+    
     protected TypesHandler typesHandler;
     protected ExtendedTypeMap extendedTypes;
     protected boolean supportsBatchUpdates;
@@ -76,6 +78,9 @@ public class JdbcAdapter implements DbAd
      */
     @Inject
     protected BatchQueryBuilderFactory batchQueryBuilderFactory;
+    
+    @Inject
+    protected JdbcEventLogger logger;
 
     /**
      * @since 3.0
@@ -101,8 +106,6 @@ public class JdbcAdapter implements DbAd
 
         // TODO: andrus 05.02.2010 - ideally this should be injected
         this.resourceLocator = new ClassLoaderResourceLocator();
-
-        this.pkGenerator = createPkGenerator();
         this.typesHandler = TypesHandler.getHandler(findResource("/types.xml"));
         this.extendedTypes = new ExtendedTypeMap();
         this.configureExtendedTypes(extendedTypes);
@@ -118,6 +121,13 @@ public class JdbcAdapter implements DbAd
     public String getBatchTerminator() {
         return ";";
     }
+    
+    /**
+     * @since 3.1
+     */
+    public JdbcEventLogger getJdbcEventLogger() {
+        return this.logger;
+    }
 
     /**
      * Locates and returns a named adapter resource. A resource can be an XML file, etc.
@@ -180,6 +190,9 @@ public class JdbcAdapter implements DbAd
      * Returns primary key generator associated with this DbAdapter.
      */
     public PkGenerator getPkGenerator() {
+        if (pkGenerator == null) {
+            pkGenerator = createPkGenerator();
+        }
         return pkGenerator;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/JdbcPkGenerator.java Sat Jul  9 19:50:55 2011
@@ -35,8 +35,8 @@ import org.apache.cayenne.CayenneRuntime
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.ResultIterator;
+import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbKeyGenerator;
@@ -56,10 +56,13 @@ public class JdbcPkGenerator implements 
 
     protected Map<String, LongPkRange> pkCache = new HashMap<String, LongPkRange>();
     protected int pkCacheSize = DEFAULT_PK_CACHE_SIZE;
+    
+    protected JdbcEventLogger logger;
 
     public JdbcPkGenerator(JdbcAdapter adapter) {
         super();
         this.adapter = adapter;
+        this.logger = adapter.getJdbcEventLogger();
     }
 
     public JdbcAdapter getAdapter() {
@@ -198,7 +201,7 @@ public class JdbcPkGenerator implements 
      * @throws SQLException in case of query failure.
      */
     public int runUpdate(DataNode node, String sql) throws SQLException {
-        QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+        logger.logQuery(sql, Collections.EMPTY_LIST);
 
         Connection con = node.getDataSource().getConnection();
         try {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2PkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2PkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2PkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2PkGenerator.java Sat Jul  9 19:50:55 2011
@@ -29,7 +29,6 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
@@ -62,7 +61,7 @@ public class DB2PkGenerator extends Jdbc
                 String sql = "SELECT NEXTVAL FOR "
                         + pkGeneratingSequenceName
                         + " FROM SYSIBM.SYSDUMMY1";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = st.executeQuery(sql);
                 try {
                     // Object pk = null;
@@ -161,7 +160,7 @@ public class DB2PkGenerator extends Jdbc
                         "WHERE SEQNAME LIKE '").append(_SEQUENCE_PREFIX).append("%'");
 
                 String sql = buffer.toString();
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = sel.executeQuery(sql);
                 try {
                     List<String> sequenceList = new ArrayList<String>();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java Sat Jul  9 19:50:55 2011
@@ -27,7 +27,6 @@ import java.sql.Types;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
-import org.apache.cayenne.access.trans.TrimmingQualifierTranslator;
 import org.apache.cayenne.access.types.ByteType;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyPkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyPkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/derby/DerbyPkGenerator.java Sat Jul  9 19:50:55 2011
@@ -26,7 +26,6 @@ import java.util.Collections;
 
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.map.DbEntity;
@@ -52,8 +51,8 @@ public class DerbyPkGenerator extends Jd
     @Override
     protected long longPkFromDatabase(DataNode node, DbEntity entity) throws Exception {
 
-        if (QueryLogger.isLoggable()) {
-            QueryLogger.logQuery(SELECT_QUERY, Collections
+        if (logger.isLoggable()) {
+            logger.logQuery(SELECT_QUERY, Collections
                     .singletonList(entity.getName()));
         }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -37,7 +37,7 @@ class FrontBaseActionBuilder extends Jdb
 
     @Override
     public SQLAction objectSelectAction(SelectQuery query) {
-        return new SelectAction(query, adapter, entityResolver) {
+        SelectAction action = new SelectAction(query, adapter, entityResolver) {
 
             @Override
             protected SelectTranslator createTranslator(Connection connection) {
@@ -46,8 +46,11 @@ class FrontBaseActionBuilder extends Jdb
                 translator.setAdapter(adapter);
                 translator.setEntityResolver(getEntityResolver());
                 translator.setConnection(connection);
+                translator.setJdbcEventLogger(logger);
                 return translator;
             }
         };
+
+        return action;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -43,7 +43,7 @@ class HSQLActionBuilder extends JdbcActi
 
     @Override
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new ProcedureAction(query, adapter, entityResolver) {
+        ProcedureAction procedureAction = new ProcedureAction(query, adapter, entityResolver) {
 
             @Override
             protected ProcedureTranslator createTranslator(Connection connection) {
@@ -52,9 +52,12 @@ class HSQLActionBuilder extends JdbcActi
                 transl.setQuery(query);
                 transl.setEntityResolver(getEntityResolver());
                 transl.setConnection(connection);
+                transl.setJdbcEventLogger(logger);
                 return transl;
             }
         };
+        
+        return procedureAction;
     }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java Sat Jul  9 19:50:55 2011
@@ -47,6 +47,7 @@ class HSQLSelectAction extends SelectAct
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresPkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresPkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresPkGenerator.java Sat Jul  9 19:50:55 2011
@@ -29,7 +29,6 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.oracle.OraclePkGenerator;
 import org.apache.cayenne.map.DbEntity;
@@ -63,7 +62,7 @@ public class IngresPkGenerator extends O
             Statement st = con.createStatement();
             try {
                 String sql = "SELECT " + pkGeneratingSequenceName + ".nextval";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = st.executeQuery(sql);
                 try {
                     // Object pk = null;
@@ -96,7 +95,7 @@ public class IngresPkGenerator extends O
             Statement select = connection.createStatement();
             try {
                 String sql = "select seq_name from iisequences where seq_owner != 'DBA'";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = select.executeQuery(sql);
                 try {
                     List<String> sequenceList = new ArrayList<String>();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java Sat Jul  9 19:50:55 2011
@@ -110,8 +110,8 @@ public class MySQLAdapter extends JdbcAd
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new MySQLActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new MySQLActionBuilder(this, node.getEntityResolver()));
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLPkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLPkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLPkGenerator.java Sat Jul  9 19:50:55 2011
@@ -26,7 +26,6 @@ import java.sql.Statement;
 import java.util.Collections;
 
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.map.DbEntity;
@@ -91,7 +90,7 @@ public class MySQLPkGenerator extends Jd
                 // TABLE!!
                 try {
                     String unlockString = "UNLOCK TABLES";
-                    QueryLogger.logQuery(unlockString, Collections.EMPTY_LIST);
+                    logger.logQuery(unlockString, Collections.EMPTY_LIST);
                     st.execute(unlockString);
                 }
                 catch (SQLException unlockEx) {
@@ -159,14 +158,14 @@ public class MySQLPkGenerator extends Jd
             throws SQLException {
         // lock
         String lockString = "LOCK TABLES AUTO_PK_SUPPORT WRITE";
-        QueryLogger.logQuery(lockString, Collections.EMPTY_LIST);
+        logger.logQuery(lockString, Collections.EMPTY_LIST);
         statement.execute(lockString);
 
         // select
         long pk = -1;
 
         String selectString = super.pkSelectString(entityName);
-        QueryLogger.logQuery(selectString, Collections.EMPTY_LIST);
+        logger.logQuery(selectString, Collections.EMPTY_LIST);
         ResultSet rs = statement.executeQuery(selectString);
         try {
             if (!rs.next()) {
@@ -190,7 +189,7 @@ public class MySQLPkGenerator extends Jd
 
         // update
         String updateString = super.pkUpdateString(entityName) + " AND NEXT_ID = " + pk;
-        QueryLogger.logQuery(updateString, Collections.EMPTY_LIST);
+        logger.logQuery(updateString, Collections.EMPTY_LIST);
         int updated = statement.executeUpdate(updateString);
         // optimistic lock failure...
         if (updated != 1) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java Sat Jul  9 19:50:55 2011
@@ -24,7 +24,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
@@ -112,7 +111,7 @@ class MySQLProcedureAction extends Proce
         if (updateCount == -1) {
             return false;
         }
-        QueryLogger.logUpdateCount(updateCount);
+        logger.logUpdateCount(updateCount);
         observer.nextCount(query, updateCount);
 
         return true;
@@ -129,6 +128,7 @@ class MySQLProcedureAction extends Proce
         translator.setQuery(query);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java Sat Jul  9 19:50:55 2011
@@ -48,6 +48,7 @@ class MySQLSelectAction extends SelectAc
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -40,7 +40,7 @@ class OpenBaseActionBuilder extends Jdbc
 
     @Override
     public SQLAction objectSelectAction(SelectQuery query) {
-        return new SelectAction(query, adapter, entityResolver) {
+        SelectAction action = new SelectAction(query, adapter, entityResolver) {
 
             @Override
             protected SelectTranslator createTranslator(Connection connection) {
@@ -49,8 +49,11 @@ class OpenBaseActionBuilder extends Jdbc
                 translator.setAdapter(adapter);
                 translator.setEntityResolver(getEntityResolver());
                 translator.setConnection(connection);
+                translator.setJdbcEventLogger(logger);
                 return translator;
             }
         };
+        
+        return action;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java Sat Jul  9 19:50:55 2011
@@ -72,8 +72,8 @@ public class OpenBaseAdapter extends Jdb
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new OpenBaseActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new OpenBaseActionBuilder(this, node.getEntityResolver()));
     }
 
     @Override

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBasePkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBasePkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBasePkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBasePkGenerator.java Sat Jul  9 19:50:55 2011
@@ -31,7 +31,6 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
@@ -93,7 +92,7 @@ public class OpenBasePkGenerator extends
     protected long longPkFromDatabase(DataNode node, DbEntity entity) throws Exception {
 
         String sql = newIDString(entity);
-        QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+        logger.logQuery(sql, Collections.EMPTY_LIST);
 
         Connection con = node.getDataSource().getConnection();
         try {
@@ -148,7 +147,7 @@ public class OpenBasePkGenerator extends
         // result in errors...
 
         // create needed sequences
-        Iterator it = dbEntities.iterator();
+        Iterator<?> it = dbEntities.iterator();
         while (it.hasNext()) {
             DbEntity entity = (DbEntity) it.next();
 
@@ -169,7 +168,7 @@ public class OpenBasePkGenerator extends
     @Override
     public List createAutoPkStatements(List dbEntities) {
         List<String> list = new ArrayList<String>(2 * dbEntities.size());
-        Iterator it = dbEntities.iterator();
+        Iterator<?> it = dbEntities.iterator();
         while (it.hasNext()) {
             DbEntity entity = (DbEntity) it.next();
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -19,6 +19,8 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.apache.cayenne.access.jdbc.BatchAction;
+import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.BatchQuery;
@@ -39,7 +41,9 @@ class Oracle8ActionBuilder extends Oracl
 
     @Override
     public SQLAction sqlAction(SQLTemplate query) {
-        return new Oracle8SQLTemplateAction(query, adapter, getEntityResolver());
+        SQLTemplateAction action = new Oracle8SQLTemplateAction(query, adapter, getEntityResolver());
+        action.setJdbcEventLogger(logger);
+        return action;
     }
 
     @Override
@@ -52,7 +56,9 @@ class Oracle8ActionBuilder extends Oracl
         // special handling for LOB updates
         if (OracleAdapter.isSupportsOracleLOB() && OracleAdapter.updatesLOBColumns(query)) {
             // Special action for Oracle8. See CAY-1307.
-            return new Oracle8LOBBatchAction(query, getAdapter());
+            OracleLOBBatchAction action = new Oracle8LOBBatchAction(query, getAdapter());
+            action.setJdbcEventLogger(logger);
+            return action;
         }
         else {
             // optimistic locking is not supported in batches due to JDBC driver
@@ -60,11 +66,11 @@ class Oracle8ActionBuilder extends Oracl
             boolean useOptimisticLock = query.isUsingOptimisticLocking();
             boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates();
 
-            OracleBatchAction action = new OracleBatchAction(
+            BatchAction action = new OracleBatchAction(
                     query,
                     adapter,
                     getEntityResolver());
-            action.setBatch(runningAsBatch);
+            ((OracleBatchAction)action).setBatch(runningAsBatch);
             return action;
         }
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java Sat Jul  9 19:50:55 2011
@@ -26,7 +26,6 @@ import java.sql.SQLException;
 import java.util.Collection;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.jdbc.SQLStatement;
 import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.DbAdapter;
@@ -89,7 +88,7 @@ class Oracle8SQLTemplateAction extends S
             else {
                 int updateCount = statement.executeUpdate();
                 updateCounts.add(Integer.valueOf(updateCount));
-                QueryLogger.logUpdateCount(updateCount);
+                getJdbcEventLogger().logUpdateCount(updateCount);
             }
 
             // end - code different from super

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java Sat Jul  9 19:50:55 2011
@@ -42,6 +42,7 @@ class Oracle8SelectAction extends Oracle
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -19,6 +19,8 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.apache.cayenne.access.jdbc.BatchAction;
+import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -39,7 +41,9 @@ class OracleActionBuilder extends JdbcAc
 
     @Override
     public SQLAction sqlAction(SQLTemplate query) {
-        return new OracleSQLTemplateAction(query, adapter, getEntityResolver());
+        SQLTemplateAction action = new Oracle8SQLTemplateAction(query, adapter, getEntityResolver());
+        action.setJdbcEventLogger(logger);
+        return action;
     }
 
     @Override
@@ -47,7 +51,9 @@ class OracleActionBuilder extends JdbcAc
 
         // special handling for LOB updates
         if (OracleAdapter.isSupportsOracleLOB() && OracleAdapter.updatesLOBColumns(query)) {
-            return new OracleLOBBatchAction(query, getAdapter());
+            OracleLOBBatchAction action = new OracleLOBBatchAction(query, getAdapter());
+            action.setJdbcEventLogger(logger);
+            return action;
         }
         else {
 
@@ -56,11 +62,11 @@ class OracleActionBuilder extends JdbcAc
             boolean useOptimisticLock = query.isUsingOptimisticLocking();
             boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates();
 
-            OracleBatchAction action = new OracleBatchAction(
+            BatchAction action = new OracleBatchAction(
                     query,
                     adapter,
                     getEntityResolver());
-            action.setBatch(runningAsBatch);
+            ((OracleBatchAction)action).setBatch(runningAsBatch);
             return action;
         }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java Sat Jul  9 19:50:55 2011
@@ -298,8 +298,8 @@ public class OracleAdapter extends JdbcA
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new OracleActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new OracleActionBuilder(this, node.getEntityResolver()));
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java Sat Jul  9 19:50:55 2011
@@ -34,12 +34,13 @@ import java.util.List;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.trans.LOBBatchQueryBuilder;
 import org.apache.cayenne.access.trans.LOBBatchQueryWrapper;
 import org.apache.cayenne.access.trans.LOBInsertBatchQueryBuilder;
 import org.apache.cayenne.access.trans.LOBUpdateBatchQueryBuilder;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.log.JdbcEventLogger;
+import org.apache.cayenne.log.NoopJdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.query.BatchQuery;
 import org.apache.cayenne.query.InsertBatchQuery;
@@ -54,15 +55,26 @@ class OracleLOBBatchAction implements SQ
 
     BatchQuery query;
     DbAdapter adapter;
+    
+    protected JdbcEventLogger logger;
 
     OracleLOBBatchAction(BatchQuery query, DbAdapter adapter) {
         this.adapter = adapter;
         this.query = query;
+        this.logger = NoopJdbcEventLogger.getInstance();
     }
 
     DbAdapter getAdapter() {
         return adapter;
     }
+    
+    public void setJdbcEventLogger(JdbcEventLogger logger) {
+        this.logger = logger;
+    }
+    
+    public JdbcEventLogger getJdbcEventLogger() {
+        return this.logger;
+    }
 
     public void performAction(Connection connection, OperationObserver observer)
             throws SQLException, Exception {
@@ -91,7 +103,7 @@ class OracleLOBBatchAction implements SQ
         List<DbAttribute> qualifierAttributes = selectQuery
                 .getDbAttributesForLOBSelectQualifier();
 
-        boolean isLoggable = QueryLogger.isLoggable();
+        boolean isLoggable = getJdbcEventLogger().isLoggable();
 
         query.reset();
         while (selectQuery.next()) {
@@ -99,13 +111,13 @@ class OracleLOBBatchAction implements SQ
             String updateStr = queryBuilder.createSqlString(query);
 
             // 1. run row update
-            QueryLogger.logQuery(updateStr, Collections.EMPTY_LIST);
+            logger.logQuery(updateStr, Collections.EMPTY_LIST);
             PreparedStatement statement = connection.prepareStatement(updateStr);
             try {
 
                 if (isLoggable) {
                     List bindings = queryBuilder.getValuesForLOBUpdateParameters(query);
-                    QueryLogger.logQueryParameters(
+                    logger.logQueryParameters(
                             "bind",
                             null,
                             bindings,
@@ -114,7 +126,7 @@ class OracleLOBBatchAction implements SQ
 
                 queryBuilder.bindParameters(statement, query);
                 updated = statement.executeUpdate();
-                QueryLogger.logUpdateCount(updated);
+                logger.logUpdateCount(updated);
             }
             finally {
                 try {
@@ -144,7 +156,7 @@ class OracleLOBBatchAction implements SQ
             return;
         }
 
-        boolean isLoggable = QueryLogger.isLoggable();
+        boolean isLoggable = getJdbcEventLogger().isLoggable();
 
         List qualifierValues = selectQuery.getValuesForLOBSelectQualifier();
         List lobValues = selectQuery.getValuesForUpdatedLOBColumns();
@@ -157,8 +169,8 @@ class OracleLOBBatchAction implements SQ
                 qualifierAttributes);
 
         if (isLoggable) {
-            QueryLogger.logQuery(selectStr, qualifierValues);
-            QueryLogger.logQueryParameters("write LOB", null, lobValues, false);
+            getJdbcEventLogger().logQuery(selectStr, qualifierValues);
+            getJdbcEventLogger().logQueryParameters("write LOB", null, lobValues, false);
         }
 
         PreparedStatement selectStatement = con.prepareStatement(selectStr);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OraclePkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OraclePkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OraclePkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OraclePkGenerator.java Sat Jul  9 19:50:55 2011
@@ -30,7 +30,6 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.JdbcPkGenerator;
 import org.apache.cayenne.dba.QuotingStrategy;
@@ -174,7 +173,7 @@ public class OraclePkGenerator extends J
             Statement st = con.createStatement();
             try {
                 String sql = "SELECT " + pkGeneratingSequenceName + ".nextval FROM DUAL";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = st.executeQuery(sql);
                 try {
                     // Object pk = null;
@@ -267,7 +266,7 @@ public class OraclePkGenerator extends J
             Statement sel = con.createStatement();
             try {
                 String sql = "SELECT LOWER(SEQUENCE_NAME) FROM ALL_SEQUENCES";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = sel.executeQuery(sql);
                 try {
                     List<String> sequenceList = new ArrayList<String>();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java Sat Jul  9 19:50:55 2011
@@ -27,7 +27,6 @@ import java.util.List;
 
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.jdbc.ColumnDescriptor;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
@@ -105,7 +104,7 @@ class OracleProcedureAction extends Proc
 
         if (result != null && !result.isEmpty()) {
             // treat out parameters as a separate data row set
-            QueryLogger.logSelectCount(1, System.currentTimeMillis() - t1);
+            logger.logSelectCount(1, System.currentTimeMillis() - t1);
             delegate.nextRows(query, Collections.singletonList(result));
         }
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java Sat Jul  9 19:50:55 2011
@@ -44,6 +44,7 @@ class OracleSelectAction extends SelectA
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectTranslator.java Sat Jul  9 19:50:55 2011
@@ -21,7 +21,6 @@ package org.apache.cayenne.dba.oracle;
 
 import java.sql.PreparedStatement;
 
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.trans.SelectTranslator;
 
 /**
@@ -54,7 +53,7 @@ class OracleSelectTranslator extends Sel
     @Override
     public PreparedStatement createStatement() throws Exception {
         String sqlStr = createSqlString();
-        QueryLogger.logQuery(sqlStr, values);
+        logger.logQuery(sqlStr, values);
         PreparedStatement stmt = connection.prepareStatement(sqlStr);
 
         initStatement(stmt);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java Sat Jul  9 19:50:55 2011
@@ -68,8 +68,8 @@ public class PostgresAdapter extends Jdb
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new PostgresActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new PostgresActionBuilder(this, node.getEntityResolver()));
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresPkGenerator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresPkGenerator.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresPkGenerator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresPkGenerator.java Sat Jul  9 19:50:55 2011
@@ -29,7 +29,6 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.oracle.OraclePkGenerator;
@@ -80,7 +79,7 @@ public class PostgresPkGenerator extends
             Statement st = con.createStatement();
             try {
                 String sql = "SELECT nextval('" + pkGeneratingSequenceName + "')";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = st.executeQuery(sql);
                 try {
                     // Object pk = null;
@@ -127,7 +126,7 @@ public class PostgresPkGenerator extends
             Statement sel = con.createStatement();
             try {
                 String sql = "SELECT relname FROM pg_class WHERE relkind='S'";
-                QueryLogger.logQuery(sql, Collections.EMPTY_LIST);
+                logger.logQuery(sql, Collections.EMPTY_LIST);
                 ResultSet rs = sel.executeQuery(sql);
                 try {
                     List<String> sequenceList = new ArrayList<String>();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java Sat Jul  9 19:50:55 2011
@@ -53,6 +53,7 @@ class PostgresProcedureAction extends SQ
         translator.setQuery(query);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java Sat Jul  9 19:50:55 2011
@@ -48,6 +48,7 @@ class PostgresSelectAction extends Selec
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java Sat Jul  9 19:50:55 2011
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.dba.sqlite;
 
+import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -35,6 +36,8 @@ class SQLiteActionBuilder extends JdbcAc
 
     @Override
     public SQLAction sqlAction(SQLTemplate query) {
-        return new SQLiteSQLTemplateAction(query, adapter, getEntityResolver());
+        SQLTemplateAction action = new SQLiteSQLTemplateAction(query, adapter, getEntityResolver());
+        action.setJdbcEventLogger(logger);
+        return action;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java Sat Jul  9 19:50:55 2011
@@ -79,8 +79,8 @@ public class SQLiteAdapter extends JdbcA
 
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new SQLiteActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new SQLiteActionBuilder(this, node.getEntityResolver()));
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java Sat Jul  9 19:50:55 2011
@@ -25,7 +25,6 @@ import java.sql.SQLException;
 import java.util.Collection;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.jdbc.SQLStatement;
 import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.DbAdapter;
@@ -85,7 +84,7 @@ class SQLiteSQLTemplateAction extends SQ
             else {                
                 int updateCount = statement.executeUpdate();
                 updateCounts.add(Integer.valueOf(updateCount));
-                QueryLogger.logUpdateCount(updateCount);
+                getJdbcEventLogger().logUpdateCount(updateCount);
             }
 
             // end - code different from super

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java Sat Jul  9 19:50:55 2011
@@ -19,17 +19,11 @@
 
 package org.apache.cayenne.dba.sqlserver;
 
-import java.sql.Types;
-
-import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
-import org.apache.cayenne.dba.QuotingStrategy;
-import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.dba.sybase.SybaseAdapter;
 import org.apache.cayenne.map.DbAttribute;
-import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.merge.MergerFactory;
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
@@ -98,7 +92,8 @@ public class SQLServerAdapter extends Sy
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new SQLServerActionBuilder(this, node.getEntityResolver()));
+        return query
+                .createSQLAction(new SQLServerActionBuilder(this, node.getEntityResolver()));
     }
 
     

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java Sat Jul  9 19:50:55 2011
@@ -25,7 +25,6 @@ import java.sql.Statement;
 import java.util.Collections;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.jdbc.BatchAction;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.Attribute;
@@ -78,7 +77,7 @@ public class SQLServerBatchAction extend
                 + query.getDbEntity().getFullyQualifiedName()
                 + flag;
 
-        QueryLogger.logQuery(configSQL, Collections.EMPTY_LIST);
+        logger.logQuery(configSQL, Collections.EMPTY_LIST);
 
         Statement statement = connection.createStatement();
         try {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java Sat Jul  9 19:50:55 2011
@@ -27,7 +27,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.QueryLogger;
 import org.apache.cayenne.access.ResultIterator;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
@@ -96,7 +95,7 @@ public class SQLServerProcedureAction ex
                     if (updateCount == -1) {
                         break;
                     }
-                    QueryLogger.logUpdateCount(updateCount);
+                    logger.logUpdateCount(updateCount);
                     localObserver.nextCount(query, updateCount);
                 }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java?rev=1144723&r1=1144722&r2=1144723&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java Sat Jul  9 19:50:55 2011
@@ -40,6 +40,7 @@ public class SQLServerSelectAction exten
         translator.setAdapter(adapter);
         translator.setEntityResolver(getEntityResolver());
         translator.setConnection(connection);
+        translator.setJdbcEventLogger(logger);
         return translator;
     }
 



Mime
View raw message