cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r565364 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src: main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/dba/ main/java/org/apache/cayenne/dba/frontbase/ main/java/org/apache/cayenne/dba/hsqldb/ main...
Date Mon, 13 Aug 2007 14:25:59 GMT
Author: aadamchik
Date: Mon Aug 13 07:25:56 2007
New Revision: 565364

URL: http://svn.apache.org/viewvc?view=rev&rev=565364
Log:
CAY-819 Support for per-adapter customization of EJBQL translator

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLDeleteTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLGroupByTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectColumnsTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateItemTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslatorTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
Mon Aug 13 07:25:56 2007
@@ -22,10 +22,11 @@
 import java.sql.SQLException;
 
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.ejbql.EJBQLBaseVisitor;
 import org.apache.cayenne.ejbql.EJBQLCompiledExpression;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.EJBQLQuery;
 import org.apache.cayenne.query.SQLActionVisitor;
@@ -43,7 +44,7 @@
     protected EJBQLQuery query;
 
     public EJBQLAction(EJBQLQuery query, SQLActionVisitor actionFactory,
-            DbAdapter adapter, EntityResolver entityResolver) {
+            JdbcAdapter adapter, EntityResolver entityResolver) {
         super(adapter, entityResolver);
 
         this.query = query;
@@ -54,26 +55,32 @@
             throws SQLException, Exception {
         EJBQLCompiledExpression compiledExpression = query
                 .getExpression(getEntityResolver());
+        final EJBQLTranslatorFactory translatorFactory = ((JdbcAdapter) getAdapter())
+                .getEjbqlTranslatorFactory();
         final EJBQLTranslationContext context = new EJBQLTranslationContext(
                 compiledExpression,
-                query.getParameters());
+                query.getParameters(),
+                translatorFactory);
 
         compiledExpression.getExpression().visit(new EJBQLBaseVisitor(false) {
 
             public boolean visitSelect(EJBQLExpression expression) {
-                EJBQLSelectTranslator visitor = new EJBQLSelectTranslator(context);
+                EJBQLExpressionVisitor visitor = translatorFactory
+                        .getSelectTranslator(context);
                 expression.visit(visitor);
                 return false;
             }
 
             public boolean visitDelete(EJBQLExpression expression) {
-                EJBQLDeleteTranslator visitor = new EJBQLDeleteTranslator(context);
+                EJBQLExpressionVisitor visitor = translatorFactory
+                        .getDeleteTranslator(context);
                 expression.visit(visitor);
                 return false;
             }
 
             public boolean visitUpdate(EJBQLExpression expression) {
-                EJBQLUpdateTranslator visitor = new EJBQLUpdateTranslator(context);
+                EJBQLExpressionVisitor visitor = translatorFactory
+                        .getUpdateTranslator(context);
                 expression.visit(visitor);
                 return false;
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLConditionTranslator.java
Mon Aug 13 07:25:56 2007
@@ -66,7 +66,7 @@
     }
 
     public boolean visitAggregate(EJBQLExpression expression) {
-        expression.visit(new EJBQLAggregateColumnTranslator(context));
+        expression.visit(context.getTranslatorFactory().getAggregateColumnTranslator(context));
         return false;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLDeleteTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLDeleteTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLDeleteTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLDeleteTranslator.java
Mon Aug 13 07:25:56 2007
@@ -46,13 +46,13 @@
 
     public boolean visitFrom(EJBQLExpression expression, int finishedChildIndex) {
         context.append(" FROM");
-        expression.visit(new EJBQLFromTranslator(context));
+        expression.visit(context.getTranslatorFactory().getFromTranslator(context));
         return false;
     }
 
     public boolean visitWhere(EJBQLExpression expression) {
         context.append(" WHERE");
-        expression.visit(new EJBQLConditionTranslator(context));
+        expression.visit(context.getTranslatorFactory().getConditionTranslator(context));
         return false;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLGroupByTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLGroupByTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLGroupByTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLGroupByTranslator.java
Mon Aug 13 07:25:56 2007
@@ -37,7 +37,7 @@
     }
 
     public boolean visitIdentifier(EJBQLExpression expression) {
-        expression.visit(new EJBQLIdentifierColumnsTranslator(context));
+        expression.visit(context.getTranslatorFactory().getIdentifierColumnsTranslator(context));
         return false;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLPathTranslator.java
Mon Aug 13 07:25:56 2007
@@ -26,6 +26,7 @@
 import org.apache.cayenne.ejbql.EJBQLBaseVisitor;
 import org.apache.cayenne.ejbql.EJBQLException;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
 import org.apache.cayenne.ejbql.parser.EJBQLIdentificationVariable;
 import org.apache.cayenne.ejbql.parser.EJBQLIdentifier;
 import org.apache.cayenne.ejbql.parser.EJBQLInnerJoin;
@@ -57,7 +58,7 @@
     protected String idPath;
     protected String joinMarker;
     private String fullPath;
-    private EJBQLFromTranslator joinAppender;
+    private EJBQLExpressionVisitor joinAppender;
 
     EJBQLPathTranslator(EJBQLTranslationContext context) {
         super(true);
@@ -107,9 +108,9 @@
         return true;
     }
 
-    private EJBQLFromTranslator getJoinAppender() {
+    private EJBQLExpressionVisitor getJoinAppender() {
         if (joinAppender == null) {
-            joinAppender = new EJBQLFromTranslator(context);
+            joinAppender = context.getTranslatorFactory().getFromTranslator(context);
         }
 
         return joinAppender;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectColumnsTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectColumnsTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectColumnsTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectColumnsTranslator.java
Mon Aug 13 07:25:56 2007
@@ -49,7 +49,8 @@
     }
 
     public boolean visitAggregate(EJBQLExpression expression) {
-        expression.visit(new EJBQLAggregateColumnTranslator(context));
+        expression.visit(context.getTranslatorFactory().getAggregateColumnTranslator(
+                context));
         return false;
     }
 
@@ -79,7 +80,7 @@
 
                 if (context.isAppendingResultColumns()) {
                     String columnAlias = context.nextColumnAlias();
-                    
+
                     // TODO: andrus 6/27/2007 - the last parameter is an unofficial
                     // "jdbcType"
                     // pending CAY-813 implementation, switch to #column directive
@@ -101,7 +102,8 @@
     }
 
     public boolean visitIdentifier(EJBQLExpression expression) {
-        expression.visit(new EJBQLIdentifierColumnsTranslator(context));
+        expression.visit(context.getTranslatorFactory().getIdentifierColumnsTranslator(
+                context));
         return false;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslator.java
Mon Aug 13 07:25:56 2007
@@ -55,25 +55,25 @@
     public boolean visitFrom(EJBQLExpression expression, int finishedChildIndex) {
         context.append(" FROM");
         context.setAppendingResultColumns(false);
-        expression.visit(new EJBQLFromTranslator(context));
+        expression.visit(context.getTranslatorFactory().getFromTranslator(context));
         return false;
     }
 
     public boolean visitGroupBy(EJBQLExpression expression) {
         context.append(" GROUP BY");
-        expression.visit(new EJBQLGroupByTranslator(context));
+        expression.visit(context.getTranslatorFactory().getGroupByTranslator(context));
         return false;
     }
 
     public boolean visitHaving(EJBQLExpression expression) {
         context.append(" HAVING");
-        expression.visit(new EJBQLConditionTranslator(context));
+        expression.visit(context.getTranslatorFactory().getConditionTranslator(context));
         return false;
     }
 
     public boolean visitOrderBy(EJBQLExpression expression) {
         context.append(" ORDER BY");
-        expression.visit(new EJBQLOrderByTranslator(context));
+        expression.visit(context.getTranslatorFactory().getOrderByTranslator(context));
         return false;
     }
 
@@ -91,13 +91,14 @@
     }
 
     public boolean visitSelectExpressions(EJBQLExpression expression) {
-        expression.visit(new EJBQLSelectColumnsTranslator(context));
+        expression.visit(context.getTranslatorFactory().getSelectColumnsTranslator(
+                context));
         return false;
     }
 
     public boolean visitWhere(EJBQLExpression expression) {
         context.append(" WHERE");
-        expression.visit(new EJBQLConditionTranslator(context));
+        expression.visit(context.getTranslatorFactory().getConditionTranslator(context));
         return false;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslationContext.java
Mon Aug 13 07:25:56 2007
@@ -34,7 +34,7 @@
  * @since 3.0
  * @author Andrus Adamchik
  */
-class EJBQLTranslationContext {
+public class EJBQLTranslationContext {
 
     private Map tableAliases;
     private Map boundParameters;
@@ -46,16 +46,19 @@
     private Map parameters;
     private Map idAliases;
     private int columnAliasPosition;
+    private EJBQLTranslatorFactory translatorFactory;
 
     // a flag indicating whether column expressions should be treated as result columns or
     // not.
     private boolean appendingResultColumns;
 
-    EJBQLTranslationContext(EJBQLCompiledExpression compiledExpression, Map parameters) {
+    public EJBQLTranslationContext(EJBQLCompiledExpression compiledExpression, Map parameters,
+            EJBQLTranslatorFactory translatorFactory) {
         this.compiledExpression = compiledExpression;
         this.mainBuffer = new StringBuffer();
         this.currentBuffer = mainBuffer;
         this.parameters = parameters;
+        this.translatorFactory = translatorFactory;
     }
 
     SQLTemplate getQuery() {
@@ -78,6 +81,10 @@
         }
 
         return id;
+    }
+
+    EJBQLTranslatorFactory getTranslatorFactory() {
+        return translatorFactory;
     }
 
     /**

Added: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorFactory.java?view=auto&rev=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorFactory.java
Mon Aug 13 07:25:56 2007
@@ -0,0 +1,53 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.access.jdbc;
+
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
+/**
+ * Defines a factory for translation visitors of EJBQL. DbAdapters can customize EJBQL
+ * translation by providing their own factory implementation.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+public interface EJBQLTranslatorFactory {
+
+    EJBQLExpressionVisitor getSelectTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getDeleteTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getUpdateTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getAggregateColumnTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getConditionTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getFromTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getGroupByTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getIdentifierColumnsTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getOrderByTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getSelectColumnsTranslator(EJBQLTranslationContext context);
+
+    EJBQLExpressionVisitor getUpdateItemTranslator(EJBQLTranslationContext context);
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateItemTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateItemTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateItemTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateItemTranslator.java
Mon Aug 13 07:25:56 2007
@@ -29,7 +29,7 @@
  */
 class EJBQLUpdateItemTranslator extends EJBQLConditionTranslator {
 
-    public EJBQLUpdateItemTranslator(EJBQLTranslationContext context) {
+    EJBQLUpdateItemTranslator(EJBQLTranslationContext context) {
         super(context);
     }
 
@@ -111,7 +111,7 @@
             context.append(" NULL");
             return false;
         }
-        
+
         return true;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateTranslator.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLUpdateTranslator.java
Mon Aug 13 07:25:56 2007
@@ -47,12 +47,12 @@
 
     public boolean visitWhere(EJBQLExpression expression) {
         context.append(" WHERE");
-        expression.visit(new EJBQLConditionTranslator(context));
+        expression.visit(context.getTranslatorFactory().getConditionTranslator(context));
         return false;
     }
 
     public boolean visitFrom(EJBQLExpression expression, int finishedChildIndex) {
-        expression.visit(new EJBQLFromTranslator(context));
+        expression.visit(context.getTranslatorFactory().getFromTranslator(context));
 
         return false;
     }
@@ -65,7 +65,7 @@
             context.append(" SET");
         }
 
-        expression.visit(new EJBQLUpdateItemTranslator(context));
+        expression.visit(context.getTranslatorFactory().getUpdateItemTranslator(context));
         return false;
     }
 }

Added: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java?view=auto&rev=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/JdbcEJBQLTranslatorFactory.java
Mon Aug 13 07:25:56 2007
@@ -0,0 +1,77 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.access.jdbc;
+
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
+/**
+ * A default EJBQLTranslatorFactory.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+public class JdbcEJBQLTranslatorFactory implements EJBQLTranslatorFactory {
+
+    public EJBQLExpressionVisitor getDeleteTranslator(EJBQLTranslationContext context) {
+        return new EJBQLDeleteTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getSelectTranslator(EJBQLTranslationContext context) {
+        return new EJBQLSelectTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getUpdateTranslator(EJBQLTranslationContext context) {
+        return new EJBQLUpdateTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getAggregateColumnTranslator(
+            EJBQLTranslationContext context) {
+        return new EJBQLAggregateColumnTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getConditionTranslator(EJBQLTranslationContext context)
{
+        return new EJBQLConditionTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getFromTranslator(EJBQLTranslationContext context) {
+        return new EJBQLFromTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getGroupByTranslator(EJBQLTranslationContext context) {
+        return new EJBQLGroupByTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getIdentifierColumnsTranslator(
+            EJBQLTranslationContext context) {
+        return new EJBQLIdentifierColumnsTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getOrderByTranslator(EJBQLTranslationContext context) {
+        return new EJBQLOrderByTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getSelectColumnsTranslator(
+            EJBQLTranslationContext context) {
+        return new EJBQLSelectColumnsTranslator(context);
+    }
+
+    public EJBQLExpressionVisitor getUpdateItemTranslator(EJBQLTranslationContext context)
{
+        return new EJBQLUpdateItemTranslator(context);
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -46,10 +46,23 @@
  */
 public class JdbcActionBuilder implements SQLActionVisitor {
 
-    protected DbAdapter adapter;
+    protected JdbcAdapter adapter;
     protected EntityResolver entityResolver;
 
+    /**
+     * @deprecated since 3.0 use "JdbcActionBuilder(JdbcAdapter,EntityResolver)"
+     *             constructor instead.
+     */
     public JdbcActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+        if (!(adapter instanceof JdbcAdapter)) {
+            throw new IllegalArgumentException("Expected a non-null JdbcAdapter, got: "
+                    + adapter);
+        }
+        this.adapter = (JdbcAdapter) adapter;
+        this.entityResolver = resolver;
+    }
+
+    public JdbcActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         this.adapter = adapter;
         this.entityResolver = resolver;
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
Mon Aug 13 07:25:56 2007
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.dba;
 
 import java.net.URL;
@@ -30,6 +29,8 @@
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.access.jdbc.EJBQLTranslatorFactory;
+import org.apache.cayenne.access.jdbc.JdbcEJBQLTranslatorFactory;
 import org.apache.cayenne.access.trans.QualifierTranslator;
 import org.apache.cayenne.access.trans.QueryAssembler;
 import org.apache.cayenne.access.types.BigIntegerType;
@@ -65,6 +66,7 @@
     protected boolean supportsFkConstraints;
     protected boolean supportsUniqueConstraints;
     protected boolean supportsGeneratedKeys;
+    protected EJBQLTranslatorFactory ejbqlTranslatorFactory;
 
     /**
      * Creates new JdbcAdapter with a set of default parameters.
@@ -75,10 +77,11 @@
         this.setSupportsUniqueConstraints(true);
         this.setSupportsFkConstraints(true);
 
-        this.pkGenerator = this.createPkGenerator();
+        this.pkGenerator = createPkGenerator();
         this.typesHandler = TypesHandler.getHandler(findAdapterResource("/types.xml"));
         this.extendedTypes = new ExtendedTypeMap();
         this.configureExtendedTypes(extendedTypes);
+        this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory();
     }
 
     /**
@@ -137,13 +140,13 @@
 
         // enable "small" BLOBs
         map.registerType(new ByteArrayType(false, true));
-        
+
         // enable Calendar
         // TODO: andrus 9/1/2006 - maybe use ExtendedTypeFactory to handle all calendar
         // subclasses at once
         map.registerType(new CalendarType(GregorianCalendar.class));
         map.registerType(new CalendarType(Calendar.class));
-        
+
         map.registerType(new BigIntegerType());
     }
 
@@ -157,6 +160,17 @@
     }
 
     /**
+     * Creates and returns an {@link EJBQLTranslatorFactory} used to generate visitors for
+     * EJBQL to SQL translations. This method should be overriden by subclasses that need
+     * to customize EJBQL generation.
+     * 
+     * @since 3.0
+     */
+    protected EJBQLTranslatorFactory createEJBQLTranslatorFactory() {
+        return new JdbcEJBQLTranslatorFactory();
+    }
+
+    /**
      * Returns primary key generator associated with this DbAdapter.
      */
     public PkGenerator getPkGenerator() {
@@ -250,7 +264,6 @@
                 createTableAppendColumn(sqlBuffer, column);
             }
 
-            
             createTableAppendPKClause(sqlBuffer, entity);
         }
 
@@ -303,9 +316,7 @@
         // append size and precision (if applicable)
         if (TypesMapping.supportsLength(column.getType())) {
             int len = column.getMaxLength();
-            int scale = TypesMapping.isDecimal(column.getType())
-                    ? column.getScale()
-                    : -1;
+            int scale = TypesMapping.isDecimal(column.getType()) ? column.getScale() : -1;
 
             // sanity check
             if (scale > len) {
@@ -487,5 +498,28 @@
      */
     public void setSupportsGeneratedKeys(boolean flag) {
         this.supportsGeneratedKeys = flag;
+    }
+
+    /**
+     * Returns a translator factory for EJBQL to SQL translation. This property is
+     * normally initialized in constructor by calling
+     * {@link #createEJBQLTranslatorFactory()}, and can be overriden by calling
+     * {@link #setEjbqlTranslatorFactory(EJBQLTranslatorFactory)}.
+     * 
+     * @since 3.0
+     */
+    public EJBQLTranslatorFactory getEjbqlTranslatorFactory() {
+        return ejbqlTranslatorFactory;
+    }
+
+    /**
+     * Sets a translator factory for EJBQL to SQL translation. This property is normally
+     * initialized in constructor by calling {@link #createEJBQLTranslatorFactory()}, so
+     * users would only override it if they need to customize EJBQL translation.
+     * 
+     * @since 3.0
+     */
+    public void setEjbqlTranslatorFactory(EJBQLTranslatorFactory ejbqlTranslatorFactory)
{
+        this.ejbqlTranslatorFactory = ejbqlTranslatorFactory;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -23,15 +23,15 @@
 
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SelectQuery;
 
 class FrontBaseActionBuilder extends JdbcActionBuilder {
 
-    FrontBaseActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    FrontBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -25,8 +25,8 @@
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
 import org.apache.cayenne.access.trans.SelectTranslator;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.ProcedureQuery;
 import org.apache.cayenne.query.SQLAction;
@@ -34,7 +34,7 @@
 
 class HSQLActionBuilder extends JdbcActionBuilder {
 
-    HSQLActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    HSQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -23,8 +23,8 @@
 
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.ProcedureQuery;
 import org.apache.cayenne.query.SQLAction;
@@ -36,7 +36,7 @@
  */
 class MySQLActionBuilder extends JdbcActionBuilder {
 
-    MySQLActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    MySQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
Mon Aug 13 07:25:56 2007
@@ -27,6 +27,7 @@
 import java.util.List;
 
 import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.access.jdbc.EJBQLTranslatorFactory;
 import org.apache.cayenne.access.types.ByteArrayType;
 import org.apache.cayenne.access.types.CharType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
@@ -168,6 +169,13 @@
      */
     protected PkGenerator createPkGenerator() {
         return new MySQLPkGenerator();
+    }
+    
+    /**
+     * @since 3.0
+     */
+    protected EJBQLTranslatorFactory createEJBQLTranslatorFactory() {
+        return new MySQLEJBQLTranslatorFactory();
     }
 
     /**

Added: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java?view=auto&rev=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLEJBQLTranslatorFactory.java
Mon Aug 13 07:25:56 2007
@@ -0,0 +1,30 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.dba.mysql;
+
+import org.apache.cayenne.access.jdbc.JdbcEJBQLTranslatorFactory;
+
+/**
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+class MySQLEJBQLTranslatorFactory extends JdbcEJBQLTranslatorFactory {
+
+    // TODO: andrus 8/13/2007 - implement TRIM CHAR translation
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -23,8 +23,8 @@
 
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SelectQuery;
@@ -35,7 +35,7 @@
  */
 class OpenBaseActionBuilder extends JdbcActionBuilder {
 
-    OpenBaseActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    OpenBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.dba.oracle;
 
-import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SQLTemplate;
@@ -32,7 +32,7 @@
  */
 class Oracle8ActionBuilder extends OracleActionBuilder {
 
-    Oracle8ActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    Oracle8ActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -19,8 +19,8 @@
 
 package org.apache.cayenne.dba.oracle;
 
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.BatchQuery;
 import org.apache.cayenne.query.ProcedureQuery;
@@ -33,7 +33,7 @@
  */
 class OracleActionBuilder extends JdbcActionBuilder {
 
-    OracleActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    OracleActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -23,8 +23,8 @@
 
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.ProcedureQuery;
 import org.apache.cayenne.query.SQLAction;
@@ -36,7 +36,7 @@
  */
 class PostgresActionBuilder extends JdbcActionBuilder {
 
-    public PostgresActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    public PostgresActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java
Mon Aug 13 07:25:56 2007
@@ -20,8 +20,8 @@
 package org.apache.cayenne.dba.sqlserver;
 
 import org.apache.cayenne.access.jdbc.BatchAction;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.BatchQuery;
 import org.apache.cayenne.query.ProcedureQuery;
@@ -33,7 +33,7 @@
  */
 public class SQLServerActionBuilder extends JdbcActionBuilder {
 
-    public SQLServerActionBuilder(DbAdapter adapter, EntityResolver resolver) {
+    public SQLServerActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
         super(adapter, resolver);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslatorTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslatorTest.java?view=diff&rev=565364&r1=565363&r2=565364
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslatorTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLSelectTranslatorTest.java
Mon Aug 13 07:25:56 2007
@@ -39,7 +39,10 @@
         EJBQLCompiledExpression select = parser.compile(ejbql, getDomain()
                 .getEntityResolver());
 
-        EJBQLTranslationContext tr = new EJBQLTranslationContext(select, parameters);
+        EJBQLTranslationContext tr = new EJBQLTranslationContext(
+                select,
+                parameters,
+                new JdbcEJBQLTranslatorFactory());
         select.getExpression().visit(new EJBQLSelectTranslator(tr));
         return tr.getQuery();
     }



Mime
View raw message