cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r526696 [1/3] - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src: main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/ejbql/ main/java/org/apache/cayenne/ejbql/parser/ main/jjtree/org/apache/cayenne/ejbql/ ...
Date Mon, 09 Apr 2007 09:55:04 GMT
Author: aadamchik
Date: Mon Apr  9 02:54:53 2007
New Revision: 526696

URL: http://svn.apache.org/viewvc?view=rev&rev=526696
Log:
CAY-452: EJB QL Cayenne Query
* first cut of join support
* refactored ejbql compilation pipeline

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/Compiler.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLJoin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/ejbql/parser/
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java
Removed:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.java
Modified:
    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/EJBQLFromTranslator.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/EJBQLSelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLBaseVisitor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLCompiledExpression.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLExpressionVisitor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/CompiledExpression.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbs.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbstractSchemaName.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAdd.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAggregate.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAll.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAnd.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAny.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAscending.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAverage.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBetween.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBooleanLiteral.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLClassName.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConcat.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameters.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCount.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentDate.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTime.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTimestamp.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDecimalLiteral.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDelete.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDescending.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDistinct.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDistinctPath.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLDivide.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLEquals.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLEscapeCharacter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLExists.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLFrom.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLFromItem.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLGreaterOrEqual.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLGreaterThan.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLGroupBy.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLHaving.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIdentificationVariable.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIdentifier.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIn.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLInnerFetchJoin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLInnerJoin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIntegerLiteral.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIsEmpty.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLIsNull.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLength.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLessOrEqual.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLessThan.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLike.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLocate.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLLower.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLMax.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLMemberOf.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLMin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLMod.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLMultiply.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLNamedInputParameter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLNegative.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLNot.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLNotEquals.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLOr.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLOrderBy.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLOrderByItem.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLOuterFetchJoin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLOuterJoin.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLPath.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLPatternValue.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLPositionalInputParameter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSelect.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSelectClause.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSelectExpression.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSelectExpressions.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSize.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSqrt.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLStringLiteral.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSubselect.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSubstring.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSubtract.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLSum.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTok.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTrim.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTrimBoth.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTrimCharacter.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTrimLeading.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLTrimTrailing.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLUpdate.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLUpdateField.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLUpdateItem.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLUpdateValue.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLUpper.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLWhere.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/EJBQLParser.jjt
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLJoinsTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/jdbc/EJBQLTranslatorTest.java

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=526696&r1=526695&r2=526696
==============================================================================
--- 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 Apr  9 02:54:53 2007
@@ -23,6 +23,7 @@
 import org.apache.cayenne.ejbql.EJBQLDelegatingVisitor;
 import org.apache.cayenne.ejbql.EJBQLException;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.parser.EJBQLPath;
 
 /**
  * @since 3.0
@@ -183,7 +184,7 @@
         }
     }
 
-    public boolean visitPath(EJBQLExpression expression, int finishedChildIndex) {
+    public boolean visitPath(EJBQLPath expression, int finishedChildIndex) {
         if (finishedChildIndex < 0) {
             setDelegate(new EJBQLPathTranslator(parent));
             return true;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLFromTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLFromTranslator.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLFromTranslator.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/EJBQLFromTranslator.java Mon Apr  9 02:54:53 2007
@@ -18,32 +18,121 @@
  ****************************************************************/
 package org.apache.cayenne.access.jdbc;
 
+import java.util.Iterator;
+
 import org.apache.cayenne.ejbql.EJBQLBaseVisitor;
-import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.EJBQLException;
+import org.apache.cayenne.ejbql.parser.EJBQLFromItem;
+import org.apache.cayenne.ejbql.parser.EJBQLJoin;
+import org.apache.cayenne.map.DbJoin;
+import org.apache.cayenne.map.DbRelationship;
+import org.apache.cayenne.map.ObjRelationship;
+import org.apache.cayenne.reflect.ClassDescriptor;
 
 public class EJBQLFromTranslator extends EJBQLBaseVisitor {
 
     private EJBQLSelectTranslator parent;
+    private String lastTableAlias;
 
     public EJBQLFromTranslator(EJBQLSelectTranslator parent) {
-        super(false);
+        super(true);
         this.parent = parent;
     }
 
-    public boolean visitFromItem(EJBQLExpression expression) {
+    public boolean visitFromItem(EJBQLFromItem expression, int finishedChildIndex) {
+        if (finishedChildIndex < 0) {
+            if (lastTableAlias != null) {
+                parent.getParent().getBuffer().append(',');
+            }
+
+            lastTableAlias = appendTable(expression.getId());
+        }
         return true;
     }
 
-    public boolean visitAbstractSchemaName(EJBQLExpression expression) {
-        return true;
+    public boolean visitInnerFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+        // TODO: andrus, 4/9/2007 - support for prefetching
+        return visitInnerJoin(join, finishedChildIndex);
     }
 
-    public boolean visitIdentifier(EJBQLExpression expression) {
-        parent.appendRootIdentifier(expression.getText());
+    public boolean visitInnerJoin(EJBQLJoin join, int finishedChildIndex) {
+        if (finishedChildIndex < 0) {
+            appendJoin(join, "INNER JOIN");
+        }
         return true;
     }
 
-    public boolean visitIdentificationVariable(EJBQLExpression expression) {
+    public boolean visitOuterFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+        // TODO: andrus, 4/9/2007 - support for prefetching
+        return visitOuterJoin(join, finishedChildIndex);
+    }
+
+    public boolean visitOuterJoin(EJBQLJoin join, int finishedChildIndex) {
+        if (finishedChildIndex < 0) {
+            appendJoin(join, "LEFT OUTER JOIN");
+        }
         return true;
+    }
+
+    private void appendJoin(EJBQLJoin join, String semantics) {
+
+        String id = join.getId();
+
+        if (lastTableAlias == null) {
+            throw new EJBQLException("No source table for join: " + id);
+        }
+
+        String sourceAlias = lastTableAlias;
+        StringBuffer buffer = parent.getParent().getBuffer();
+
+        buffer.append(" ").append(semantics);
+        String targetAlias = appendTable(id);
+        buffer.append(" ON (");
+
+        ObjRelationship incoming = parent
+                .getParent()
+                .getCompiledExpression()
+                .getIncomingRelationship(id);
+        if (incoming == null) {
+            throw new EJBQLException("No join configured for id " + id);
+        }
+
+        // TODO: andrus, 4/8/2007 - support for flattened relationships
+        DbRelationship incomingDB = (DbRelationship) incoming.getDbRelationships().get(0);
+
+        Iterator it = incomingDB.getJoins().iterator();
+        if (it.hasNext()) {
+            DbJoin dbJoin = (DbJoin) it.next();
+            buffer.append(sourceAlias).append('.').append(dbJoin.getSourceName()).append(
+                    " = ").append(targetAlias).append('.').append(dbJoin.getTargetName());
+        }
+
+        while (it.hasNext()) {
+            buffer.append(", ");
+            DbJoin dbJoin = (DbJoin) it.next();
+            buffer.append(sourceAlias).append('.').append(dbJoin.getSourceName()).append(
+                    " = ").append(targetAlias).append('.').append(dbJoin.getTargetName());
+        }
+
+        buffer.append(")");
+        this.lastTableAlias = targetAlias;
+    }
+
+    private String appendTable(String id) {
+        ClassDescriptor descriptor = parent
+                .getParent()
+                .getCompiledExpression()
+                .getEntityDescriptor(id);
+
+        String tableName = descriptor.getEntity().getDbEntity().getFullyQualifiedName();
+        String alias = parent.getParent().createAlias(id, tableName);
+        parent
+                .getParent()
+                .getBuffer()
+                .append(' ')
+                .append(tableName)
+                .append(" AS ")
+                .append(alias);
+        return alias;
     }
 }

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=526696&r1=526695&r2=526696
==============================================================================
--- 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 Apr  9 02:54:53 2007
@@ -21,6 +21,7 @@
 import org.apache.cayenne.ejbql.EJBQLBaseVisitor;
 import org.apache.cayenne.ejbql.EJBQLException;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.parser.EJBQLPath;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
@@ -39,7 +40,7 @@
         this.parent = parent;
     }
 
-    public boolean visitPath(EJBQLExpression expression, int finishedChildIndex) {
+    public boolean visitPath(EJBQLPath expression, int finishedChildIndex) {
 
         if (finishedChildIndex > 0) {
 
@@ -88,7 +89,6 @@
                     + "'");
         }
 
-        parent.appendInnerJoin(idPath + '.' + lastPathComponent);
         this.currentEntity = (ObjEntity) relationship.getTargetEntity();
     }
 

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=526696&r1=526695&r2=526696
==============================================================================
--- 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 Apr  9 02:54:53 2007
@@ -19,7 +19,6 @@
 package org.apache.cayenne.access.jdbc;
 
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.cayenne.dba.TypesMapping;
@@ -27,7 +26,6 @@
 import org.apache.cayenne.ejbql.EJBQLExpression;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
-import org.apache.cayenne.reflect.ClassDescriptor;
 
 /**
  * A translator of EJBQL select statements into SQL.
@@ -39,30 +37,11 @@
 
     private EJBQLTranslator parent;
     private Set columns;
-    private StringBuffer fromClause;
-    private Set fromIds;
-    private Set innerJoins;
 
     EJBQLSelectTranslator(EJBQLTranslator parent) {
         this.parent = parent;
     }
 
-    void appendRootIdentifier(String identifier) {
-        if (fromIds == null) {
-            fromIds = new HashSet();
-        }
-
-        fromIds.add(identifier);
-    }
-
-    void appendInnerJoin(String path) {
-        if (innerJoins == null) {
-            innerJoins = new HashSet();
-        }
-
-        innerJoins.add(path);
-    }
-
     void appendColumn(String identifier, DbAttribute column) {
         appendColumn(identifier, column, TypesMapping.getJavaBySqlType(column.getType()));
     }
@@ -95,25 +74,6 @@
         }
     }
 
-    private void postprocess() {
-
-        if (fromIds != null && fromClause != null) {
-            Iterator it = fromIds.iterator();
-            while (it.hasNext()) {
-                String id = (String) it.next();
-                ClassDescriptor descriptor = parent
-                        .getCompiledExpression()
-                        .getEntityDescriptor(id);
-                DbEntity table = descriptor.getEntity().getDbEntity();
-                String fqn = table.getFullyQualifiedName();
-                String alias = parent.createAlias(id, fqn);
-                fromClause.append(' ').append(fqn).append(' ').append(alias);
-            }
-        }
-
-        // TODO: andrus, 3/26/2007 - inner joins
-    }
-
     EJBQLTranslator getParent() {
         return parent;
     }
@@ -124,9 +84,7 @@
     }
 
     public boolean visitFrom(EJBQLExpression expression) {
-        this.fromClause = new StringBuffer(" FROM");
-        String fromId = parent.bindParameter(fromClause, "from");
-        parent.getBuffer().append(" $").append(fromId);
+        parent.getBuffer().append(" FROM");
         setDelegate(new EJBQLFromTranslator(this));
         return true;
     }
@@ -142,16 +100,15 @@
             parent.getBuffer().append("SELECT");
             setDelegate(new EJBQLSelectColumnsTranslator(this));
         }
-        else if (finishedChildIndex + 1 == expression.getChildrenCount()) {
-            postprocess();
-        }
 
         return true;
     }
 
-    public boolean visitWhere(EJBQLExpression expression) {
-        parent.getBuffer().append(" WHERE");
-        setDelegate(new EJBQLConditionTranslator(this));
+    public boolean visitWhere(EJBQLExpression expression, int finishedChildIndex) {
+        if (finishedChildIndex < 0) {
+            parent.getBuffer().append(" WHERE");
+            setDelegate(new EJBQLConditionTranslator(this));
+        }
         return true;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLBaseVisitor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLBaseVisitor.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLBaseVisitor.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLBaseVisitor.java Mon Apr  9 02:54:53 2007
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
+import org.apache.cayenne.ejbql.parser.EJBQLFromItem;
+import org.apache.cayenne.ejbql.parser.EJBQLJoin;
+import org.apache.cayenne.ejbql.parser.EJBQLPath;
+
 /**
  * A noop implementation of the EJBQL visitor that returns same preset boolean value from
  * all methods. Intended for subclassing.
@@ -157,7 +161,7 @@
         return continueFlag;
     }
 
-    public boolean visitFromItem(EJBQLExpression expression) {
+    public boolean visitFromItem(EJBQLFromItem expression, int finishedChildIndex) {
         return continueFlag;
     }
 
@@ -189,11 +193,11 @@
         return continueFlag;
     }
 
-    public boolean visitInnerFetchJoin(EJBQLExpression expression) {
+    public boolean visitInnerFetchJoin(EJBQLJoin join, int finishedChildIndex) {
         return continueFlag;
     }
 
-    public boolean visitInnerJoin(EJBQLExpression expression) {
+    public boolean visitInnerJoin(EJBQLJoin join, int finishedChildIndex) {
         return continueFlag;
     }
 
@@ -281,15 +285,15 @@
         return continueFlag;
     }
 
-    public boolean visitOuterFetchJoin(EJBQLExpression expression) {
+    public boolean visitOuterFetchJoin(EJBQLJoin join, int finishedChildIndex) {
         return continueFlag;
     }
 
-    public boolean visitOuterJoin(EJBQLExpression expression) {
+    public boolean visitOuterJoin(EJBQLJoin join, int finishedChildIndex) {
         return continueFlag;
     }
 
-    public boolean visitPath(EJBQLExpression expression, int finishedChildIndex) {
+    public boolean visitPath(EJBQLPath expression, int finishedChildIndex) {
         return continueFlag;
     }
 
@@ -381,7 +385,7 @@
         return continueFlag;
     }
 
-    public boolean visitWhere(EJBQLExpression expression) {
+    public boolean visitWhere(EJBQLExpression expression, int finishedChildIndex) {
         return continueFlag;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLCompiledExpression.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLCompiledExpression.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLCompiledExpression.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLCompiledExpression.java Mon Apr  9 02:54:53 2007
@@ -18,6 +18,9 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
+import java.util.Collection;
+
+import org.apache.cayenne.map.ObjRelationship;
 import org.apache.cayenne.reflect.ClassDescriptor;
 
 /**
@@ -34,6 +37,13 @@
     EJBQLExpression getExpression();
 
     /**
+     * Returns a collection of EJBQLExpressions each representing an implicit join in the
+     * query. The most common example of implicit joins are joins introduced by
+     * relationships in the WHERE clause.
+     */
+    Collection getImplicitJoins();
+
+    /**
      * Returns a descriptor of the root of this expression such as entity being fetched or
      * updated.
      */
@@ -43,6 +53,12 @@
      * Returns a ClassDescriptor for the id variable.
      */
     ClassDescriptor getEntityDescriptor(String identifier);
+
+    /**
+     * Returns a relationship that joins identifier with a parent entity. Returns null if
+     * the identifier corresponds to one of the query roots.
+     */
+    ObjRelationship getIncomingRelationship(String identifier);
 
     /**
      * Returns EJB QL source of the compiled expression if available.

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java Mon Apr  9 02:54:53 2007
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
+import org.apache.cayenne.ejbql.parser.EJBQLFromItem;
+import org.apache.cayenne.ejbql.parser.EJBQLJoin;
+import org.apache.cayenne.ejbql.parser.EJBQLPath;
+
 /**
  * A base implementation of the EJBQLExpressionVisitor that implements all methods to
  * delegate processing to another visitor. This is a convenience superclass for visitors
@@ -30,6 +34,16 @@
 
     protected EJBQLExpressionVisitor delegate;
 
+    protected boolean continueFlag;
+
+    public EJBQLDelegatingVisitor() {
+        this(false);
+    }
+
+    public EJBQLDelegatingVisitor(boolean continueFlag) {
+        this.continueFlag = continueFlag;
+    }
+
     protected void setDelegate(EJBQLExpressionVisitor delegate) {
         this.delegate = delegate;
     }
@@ -39,390 +53,416 @@
     }
 
     public boolean visitAbs(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAbs(expression) : false;
+        return delegate != null ? delegate.visitAbs(expression) : continueFlag;
     }
 
     public boolean visitAbstractSchemaName(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAbstractSchemaName(expression) : false;
+        return delegate != null
+                ? delegate.visitAbstractSchemaName(expression)
+                : continueFlag;
     }
 
     public boolean visitAdd(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitAdd(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitAggregate(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAggregate(expression) : false;
+        return delegate != null ? delegate.visitAggregate(expression) : continueFlag;
     }
 
     public boolean visitAll(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAll(expression) : false;
+        return delegate != null ? delegate.visitAll(expression) : continueFlag;
     }
 
     public boolean visitAnd(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitAnd(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitAny(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAny(expression) : false;
+        return delegate != null ? delegate.visitAny(expression) : continueFlag;
     }
 
     public boolean visitAscending(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAscending(expression) : false;
+        return delegate != null ? delegate.visitAscending(expression) : continueFlag;
     }
 
     public boolean visitAverage(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitAverage(expression) : false;
+        return delegate != null ? delegate.visitAverage(expression) : continueFlag;
     }
 
     public boolean visitBetween(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitBetween(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitBooleanLiteral(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitBooleanLiteral(expression) : false;
+        return delegate != null ? delegate.visitBooleanLiteral(expression) : continueFlag;
     }
 
     public boolean visitClassName(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitClassName(expression) : false;
+        return delegate != null ? delegate.visitClassName(expression) : continueFlag;
     }
 
     public boolean visitConcat(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitConcat(expression) : false;
+        return delegate != null ? delegate.visitConcat(expression) : continueFlag;
     }
 
     public boolean visitConstructor(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitConstructor(expression) : false;
+        return delegate != null ? delegate.visitConstructor(expression) : continueFlag;
     }
 
     public boolean visitConstructorParameter(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitConstructorParameter(expression) : false;
+        return delegate != null
+                ? delegate.visitConstructorParameter(expression)
+                : continueFlag;
     }
 
     public boolean visitConstructorParameters(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitConstructorParameters(expression) : false;
+        return delegate != null
+                ? delegate.visitConstructorParameters(expression)
+                : continueFlag;
     }
 
     public boolean visitCount(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitCount(expression) : false;
+        return delegate != null ? delegate.visitCount(expression) : continueFlag;
     }
 
     public boolean visitCurrentDate(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitCurrentDate(expression) : false;
+        return delegate != null ? delegate.visitCurrentDate(expression) : continueFlag;
     }
 
     public boolean visitCurrentTime(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitCurrentTime(expression) : false;
+        return delegate != null ? delegate.visitCurrentTime(expression) : continueFlag;
     }
 
     public boolean visitCurrentTimestamp(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitCurrentTimestamp(expression) : false;
+        return delegate != null
+                ? delegate.visitCurrentTimestamp(expression)
+                : continueFlag;
     }
 
     public boolean visitDecimalLiteral(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitDecimalLiteral(expression) : false;
+        return delegate != null ? delegate.visitDecimalLiteral(expression) : continueFlag;
     }
 
     public boolean visitDelete(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitDelete(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitDescending(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitDescending(expression) : false;
+        return delegate != null ? delegate.visitDescending(expression) : continueFlag;
     }
 
     public boolean visitDistinct(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitDistinct(expression) : false;
+        return delegate != null ? delegate.visitDistinct(expression) : continueFlag;
     }
 
     public boolean visitDistinctPath(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitDistinctPath(expression) : false;
+        return delegate != null ? delegate.visitDistinctPath(expression) : continueFlag;
     }
 
     public boolean visitDivide(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitDivide(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitEquals(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitEquals(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitEscapeCharacter(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitEscapeCharacter(expression) : false;
+        return delegate != null
+                ? delegate.visitEscapeCharacter(expression)
+                : continueFlag;
     }
 
     public boolean visitExists(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitExists(expression) : false;
+        return delegate != null ? delegate.visitExists(expression) : continueFlag;
     }
 
     public boolean visitFrom(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitFrom(expression) : false;
+        return delegate != null ? delegate.visitFrom(expression) : continueFlag;
     }
 
-    public boolean visitFromItem(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitFromItem(expression) : false;
+    public boolean visitFromItem(EJBQLFromItem expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitFromItem(expression, finishedChildIndex)
+                : continueFlag;
     }
 
     public boolean visitGreaterOrEqual(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null ? delegate.visitGreaterOrEqual(
                 expression,
-                finishedChildIndex) : false;
+                finishedChildIndex) : continueFlag;
     }
 
     public boolean visitGreaterThan(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null ? delegate.visitGreaterThan(
                 expression,
-                finishedChildIndex) : false;
+                finishedChildIndex) : continueFlag;
     }
 
     public boolean visitGroupBy(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitGroupBy(expression) : false;
+        return delegate != null ? delegate.visitGroupBy(expression) : continueFlag;
     }
 
     public boolean visitHaving(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitHaving(expression) : false;
+        return delegate != null ? delegate.visitHaving(expression) : continueFlag;
     }
 
     public boolean visitIdentificationVariable(EJBQLExpression expression) {
         return delegate != null
                 ? delegate.visitIdentificationVariable(expression)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitIdentifier(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitIdentifier(expression) : false;
+        return delegate != null ? delegate.visitIdentifier(expression) : continueFlag;
     }
 
     public boolean visitIn(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitIn(expression) : false;
+        return delegate != null ? delegate.visitIn(expression) : continueFlag;
     }
 
-    public boolean visitInnerFetchJoin(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitInnerFetchJoin(expression) : false;
+    public boolean visitInnerFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+        return delegate != null ? delegate.visitInnerFetchJoin(
+                join,
+                finishedChildIndex) : continueFlag;
     }
 
-    public boolean visitInnerJoin(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitInnerJoin(expression) : false;
+    public boolean visitInnerJoin(EJBQLJoin join, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitInnerJoin(join, finishedChildIndex)
+                : continueFlag;
     }
 
     public boolean visitIntegerLiteral(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitIntegerLiteral(expression) : false;
+        return delegate != null ? delegate.visitIntegerLiteral(expression) : continueFlag;
     }
 
     public boolean visitIsEmpty(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitIsEmpty(expression) : false;
+        return delegate != null ? delegate.visitIsEmpty(expression) : continueFlag;
     }
 
     public boolean visitIsNull(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitIsNull(expression) : false;
+        return delegate != null ? delegate.visitIsNull(expression) : continueFlag;
     }
 
     public boolean visitLength(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitLength(expression) : false;
+        return delegate != null ? delegate.visitLength(expression) : continueFlag;
     }
 
     public boolean visitLessOrEqual(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null ? delegate.visitLessOrEqual(
                 expression,
-                finishedChildIndex) : false;
+                finishedChildIndex) : continueFlag;
     }
 
     public boolean visitLessThan(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitLessThan(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitLike(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitLike(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitLocate(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitLocate(expression) : false;
+        return delegate != null ? delegate.visitLocate(expression) : continueFlag;
     }
 
     public boolean visitLower(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitLower(expression) : false;
+        return delegate != null ? delegate.visitLower(expression) : continueFlag;
     }
 
     public boolean visitMax(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitMax(expression) : false;
+        return delegate != null ? delegate.visitMax(expression) : continueFlag;
     }
 
     public boolean visitMemberOf(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitMemberOf(expression) : false;
+        return delegate != null ? delegate.visitMemberOf(expression) : continueFlag;
     }
 
     public boolean visitMin(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitMin(expression) : false;
+        return delegate != null ? delegate.visitMin(expression) : continueFlag;
     }
 
     public boolean visitMod(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitMod(expression) : false;
+        return delegate != null ? delegate.visitMod(expression) : continueFlag;
     }
 
     public boolean visitMultiply(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitMultiply(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitNamedInputParameter(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitNamedInputParameter(expression) : false;
+        return delegate != null
+                ? delegate.visitNamedInputParameter(expression)
+                : continueFlag;
     }
 
     public boolean visitNegative(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitNegative(expression) : false;
+        return delegate != null ? delegate.visitNegative(expression) : continueFlag;
     }
 
     public boolean visitNot(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitNot(expression) : false;
+        return delegate != null ? delegate.visitNot(expression) : continueFlag;
     }
 
     public boolean visitNotEquals(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitNotEquals(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitOr(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitOr(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitOrderBy(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitOrderBy(expression) : false;
+        return delegate != null ? delegate.visitOrderBy(expression) : continueFlag;
     }
 
     public boolean visitOrderByItem(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitOrderByItem(expression) : false;
+        return delegate != null ? delegate.visitOrderByItem(expression) : continueFlag;
     }
 
-    public boolean visitOuterFetchJoin(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitOuterFetchJoin(expression) : false;
+    public boolean visitOuterFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+        return delegate != null ? delegate.visitOuterFetchJoin(
+                join,
+                finishedChildIndex) : continueFlag;
     }
 
-    public boolean visitOuterJoin(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitOuterJoin(expression) : false;
+    public boolean visitOuterJoin(EJBQLJoin join, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitOuterJoin(join, finishedChildIndex)
+                : continueFlag;
     }
 
-    public boolean visitPath(EJBQLExpression expression, int finishedChildIndex) {
+    public boolean visitPath(EJBQLPath expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitPath(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitPatternValue(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitPatternValue(expression) : false;
+        return delegate != null ? delegate.visitPatternValue(expression) : continueFlag;
     }
 
     public boolean visitPositionalInputParameter(EJBQLExpression expression) {
         return delegate != null
                 ? delegate.visitPositionalInputParameter(expression)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitSelect(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitSelect(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitSelectExpression(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSelectExpression(expression) : false;
+        return delegate != null
+                ? delegate.visitSelectExpression(expression)
+                : continueFlag;
     }
 
     public boolean visitSize(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSize(expression) : false;
+        return delegate != null ? delegate.visitSize(expression) : continueFlag;
     }
 
     public boolean visitSqrt(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSqrt(expression) : false;
+        return delegate != null ? delegate.visitSqrt(expression) : continueFlag;
     }
 
     public boolean visitStringLiteral(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitStringLiteral(expression) : false;
+        return delegate != null ? delegate.visitStringLiteral(expression) : continueFlag;
     }
 
     public boolean visitSubselect(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSubselect(expression) : false;
+        return delegate != null ? delegate.visitSubselect(expression) : continueFlag;
     }
 
     public boolean visitSubstring(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSubstring(expression) : false;
+        return delegate != null ? delegate.visitSubstring(expression) : continueFlag;
     }
 
     public boolean visitSubtract(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitSubtract(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitSum(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitSum(expression) : false;
+        return delegate != null ? delegate.visitSum(expression) : continueFlag;
     }
 
     public boolean visitTok(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTok(expression) : false;
+        return delegate != null ? delegate.visitTok(expression) : continueFlag;
     }
 
     public boolean visitTrim(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTrim(expression) : false;
+        return delegate != null ? delegate.visitTrim(expression) : continueFlag;
     }
 
     public boolean visitTrimBoth(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTrimBoth(expression) : false;
+        return delegate != null ? delegate.visitTrimBoth(expression) : continueFlag;
     }
 
     public boolean visitTrimCharacter(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTrimCharacter(expression) : false;
+        return delegate != null ? delegate.visitTrimCharacter(expression) : continueFlag;
     }
 
     public boolean visitTrimLeading(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTrimLeading(expression) : false;
+        return delegate != null ? delegate.visitTrimLeading(expression) : continueFlag;
     }
 
     public boolean visitTrimTrailing(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitTrimTrailing(expression) : false;
+        return delegate != null ? delegate.visitTrimTrailing(expression) : continueFlag;
     }
 
     public boolean visitUpdate(EJBQLExpression expression, int finishedChildIndex) {
         return delegate != null
                 ? delegate.visitUpdate(expression, finishedChildIndex)
-                : false;
+                : continueFlag;
     }
 
     public boolean visitUpdateField(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitUpdateField(expression) : false;
+        return delegate != null ? delegate.visitUpdateField(expression) : continueFlag;
     }
 
     public boolean visitUpdateItem(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitUpdateItem(expression) : false;
+        return delegate != null ? delegate.visitUpdateItem(expression) : continueFlag;
     }
 
     public boolean visitUpdateValue(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitUpdateValue(expression) : false;
+        return delegate != null ? delegate.visitUpdateValue(expression) : continueFlag;
     }
 
     public boolean visitUpper(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitUpper(expression) : false;
+        return delegate != null ? delegate.visitUpper(expression) : continueFlag;
     }
 
-    public boolean visitWhere(EJBQLExpression expression) {
-        return delegate != null ? delegate.visitWhere(expression) : false;
+    public boolean visitWhere(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitWhere(expression, finishedChildIndex)
+                : continueFlag;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLExpressionVisitor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLExpressionVisitor.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLExpressionVisitor.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLExpressionVisitor.java Mon Apr  9 02:54:53 2007
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
+import org.apache.cayenne.ejbql.parser.EJBQLFromItem;
+import org.apache.cayenne.ejbql.parser.EJBQLJoin;
+import org.apache.cayenne.ejbql.parser.EJBQLPath;
+
 /**
  * A visitor interface to inspect the EJBQL expression tree.
  * 
@@ -138,7 +142,7 @@
 
     boolean visitFrom(EJBQLExpression expression);
 
-    boolean visitFromItem(EJBQLExpression expression);
+    boolean visitFromItem(EJBQLFromItem expression, int finishedChildIndex);
 
     /**
      * Called on visiting ">=" expression and also after visiting every expression child.
@@ -170,9 +174,9 @@
 
     boolean visitIn(EJBQLExpression expression);
 
-    boolean visitInnerFetchJoin(EJBQLExpression expression);
+    boolean visitInnerFetchJoin(EJBQLJoin join, int finishedChildIndex);
 
-    boolean visitInnerJoin(EJBQLExpression expression);
+    boolean visitInnerJoin(EJBQLJoin join, int finishedChildIndex);
 
     boolean visitIntegerLiteral(EJBQLExpression expression);
 
@@ -265,9 +269,9 @@
 
     boolean visitOrderByItem(EJBQLExpression expression);
 
-    boolean visitOuterFetchJoin(EJBQLExpression expression);
+    boolean visitOuterFetchJoin(EJBQLJoin join, int finishedChildIndex);
 
-    boolean visitOuterJoin(EJBQLExpression expression);
+    boolean visitOuterJoin(EJBQLJoin join, int finishedChildIndex);
 
     /**
      * Called on visiting "path" expression and also after visiting every expression
@@ -278,7 +282,7 @@
      *            time, before its children; otherwise this is an index of a child just
      *            visited.
      */
-    boolean visitPath(EJBQLExpression expression, int finishedChildIndex);
+    boolean visitPath(EJBQLPath expression, int finishedChildIndex);
 
     boolean visitPatternValue(EJBQLExpression expression);
 
@@ -350,5 +354,5 @@
 
     boolean visitUpper(EJBQLExpression expression);
 
-    boolean visitWhere(EJBQLExpression expression);
+    boolean visitWhere(EJBQLExpression expression, int finishedChildIndex);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/CompiledExpression.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/CompiledExpression.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/CompiledExpression.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/CompiledExpression.java Mon Apr  9 02:54:53 2007
@@ -18,10 +18,13 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 
 import org.apache.cayenne.ejbql.EJBQLCompiledExpression;
 import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.map.ObjRelationship;
 import org.apache.cayenne.reflect.ClassDescriptor;
 
 /**
@@ -35,7 +38,13 @@
     private String source;
     private String rootId;
     private Map descriptorsById;
+    private Map incomingById;
     private EJBQLExpression expression;
+    private Collection implicitJoins;
+
+    public Collection getImplicitJoins() {
+        return implicitJoins != null ? implicitJoins : Collections.EMPTY_SET;
+    }
 
     public ClassDescriptor getEntityDescriptor(String idVariable) {
         if (idVariable == null) {
@@ -47,11 +56,15 @@
 
         return (ClassDescriptor) descriptorsById.get(idVariable);
     }
-    
+
     public ClassDescriptor getRootDescriptor() {
         return rootId != null ? getEntityDescriptor(rootId) : null;
     }
 
+    public ObjRelationship getIncomingRelationship(String identifier) {
+        return (ObjRelationship) incomingById.get(identifier);
+    }
+
     public EJBQLExpression getExpression() {
         return expression;
     }
@@ -68,11 +81,19 @@
         this.descriptorsById = descriptorsById;
     }
 
+    void setIncomingById(Map incomingById) {
+        this.incomingById = incomingById;
+    }
+
     void setSource(String source) {
         this.source = source;
     }
-    
+
     void setRootId(String rootId) {
         this.rootId = rootId;
+    }
+
+    void setImplicitJoins(Collection implicitJoins) {
+        this.implicitJoins = implicitJoins;
     }
 }

Added: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/Compiler.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/Compiler.java?view=auto&rev=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/Compiler.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/Compiler.java Mon Apr  9 02:54:53 2007
@@ -0,0 +1,243 @@
+/*****************************************************************
+ *   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.ejbql.parser;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cayenne.ejbql.EJBQLBaseVisitor;
+import org.apache.cayenne.ejbql.EJBQLDelegatingVisitor;
+import org.apache.cayenne.ejbql.EJBQLException;
+import org.apache.cayenne.ejbql.EJBQLExpression;
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.map.ObjRelationship;
+import org.apache.cayenne.reflect.ArcProperty;
+import org.apache.cayenne.reflect.ClassDescriptor;
+import org.apache.cayenne.reflect.Property;
+
+/**
+ * A visitor that compiles an EJBQL expression.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+class Compiler {
+
+    private String rootId;
+    private EntityResolver resolver;
+    private Map descriptorsById;
+    private Map incomingById;
+    private Collection implicitJoins;
+    private EJBQLExpressionVisitor fromItemVisitor;
+    private EJBQLExpressionVisitor joinVisitor;
+    private EJBQLExpressionVisitor whereClauseVisitor;
+    private EJBQLExpressionVisitor rootDescriptorVisitor;
+
+    Compiler(EntityResolver resolver) {
+        this.resolver = resolver;
+        this.descriptorsById = new HashMap();
+        this.incomingById = new HashMap();
+        this.implicitJoins = new ArrayList(2);
+
+        this.rootDescriptorVisitor = new SelectExpressionVisitor();
+        this.fromItemVisitor = new FromItemVisitor();
+        this.joinVisitor = new JoinVisitor();
+        this.whereClauseVisitor = new WhereClauseVisitor();
+    }
+
+    CompiledExpression compile(String source, EJBQLExpression parsed) {
+        parsed.visit(new CompilationVisitor());
+
+        CompiledExpression compiled = new CompiledExpression();
+        compiled.setExpression(parsed);
+        compiled.setSource(source);
+
+        compiled.setRootId(rootId);
+        compiled.setDescriptorsById(descriptorsById);
+        compiled.setImplicitJoins(implicitJoins);
+        compiled.setIncomingById(incomingById);
+
+        return compiled;
+    }
+
+    class CompilationVisitor extends EJBQLDelegatingVisitor {
+
+        CompilationVisitor() {
+            super(true);
+        }
+
+        public boolean visitSelectExpression(EJBQLExpression expression) {
+            updateSubtreeDelegate(rootDescriptorVisitor, expression, -1);
+            return true;
+        }
+
+        public boolean visitFromItem(EJBQLFromItem expression, int finishedChildIndex) {
+            updateSubtreeDelegate(fromItemVisitor, expression, finishedChildIndex);
+            return true;
+        }
+
+        public boolean visitInnerFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+            updateSubtreeDelegate(joinVisitor, join, finishedChildIndex);
+            return true;
+        }
+
+        public boolean visitInnerJoin(EJBQLJoin join, int finishedChildIndex) {
+            updateSubtreeDelegate(joinVisitor, join, finishedChildIndex);
+            return true;
+        }
+
+        public boolean visitOuterFetchJoin(EJBQLJoin join, int finishedChildIndex) {
+            updateSubtreeDelegate(joinVisitor, join, finishedChildIndex);
+            return true;
+        }
+
+        public boolean visitOuterJoin(EJBQLJoin join, int finishedChildIndex) {
+            updateSubtreeDelegate(joinVisitor, join, finishedChildIndex);
+            return true;
+        }
+
+        public boolean visitWhere(EJBQLExpression expression, int finishedChildIndex) {
+            updateSubtreeDelegate(whereClauseVisitor, expression, finishedChildIndex);
+            return true;
+        }
+
+        private void updateSubtreeDelegate(
+                EJBQLExpressionVisitor delegate,
+                EJBQLExpression expression,
+                int finishedChildIndex) {
+
+            if (finishedChildIndex < 0) {
+                setDelegate(delegate);
+            }
+            else if (finishedChildIndex + 1 == expression.getChildrenCount()) {
+                setDelegate(null);
+            }
+        }
+    }
+
+    class FromItemVisitor extends EJBQLBaseVisitor {
+
+        private String entityName;
+
+        public boolean visitIdentificationVariable(EJBQLExpression expression) {
+            entityName = expression.getText();
+            return true;
+        }
+
+        public boolean visitIdentifier(EJBQLExpression expression) {
+
+            // per JPA spec, 4.4.2, "Identification variables are case insensitive."
+            String rootId = expression.getText();
+            rootId = rootId.toLowerCase();
+
+            // resolve class descriptor
+            ClassDescriptor descriptor = resolver.getClassDescriptor(entityName);
+            if (descriptor == null) {
+                throw new EJBQLException("Unmapped abstract schema name: " + entityName);
+            }
+
+            ClassDescriptor old = (ClassDescriptor) descriptorsById.put(
+                    rootId,
+                    descriptor);
+            if (old != null && old != descriptor) {
+                throw new EJBQLException("Duplicate identification variable definition: "
+                        + rootId
+                        + ", it is already used for "
+                        + old.getEntity().getName());
+            }
+            return true;
+        }
+    }
+
+    class JoinVisitor extends EJBQLBaseVisitor {
+
+        private String id;
+        private ObjRelationship incoming;
+        private ClassDescriptor descriptor;
+
+        public boolean visitPath(EJBQLPath expression, int finishedChildIndex) {
+            if (finishedChildIndex + 1 < expression.getChildrenCount()) {
+                this.id = expression.getId();
+                this.descriptor = (ClassDescriptor) descriptorsById.get(id);
+
+                if (descriptor == null) {
+                    throw new EJBQLException("Unmapped id variable: " + id);
+                }
+            }
+
+            return true;
+        }
+
+        public boolean visitIdentificationVariable(EJBQLExpression expression) {
+            Property property = descriptor.getProperty(expression.getText());
+            if (property instanceof ArcProperty) {
+                incoming = ((ArcProperty) property).getRelationship();
+                descriptor = ((ArcProperty) property).getTargetDescriptor();
+            }
+            else {
+                throw new EJBQLException("Incorrect relationship path: "
+                        + expression.getText());
+            }
+
+            return true;
+        }
+
+        public boolean visitIdentifier(EJBQLExpression expression) {
+            if (incoming != null) {
+
+                String aliasId = expression.getText();
+
+                // map id variable to class descriptor
+                ClassDescriptor old = (ClassDescriptor) descriptorsById.put(
+                        aliasId,
+                        descriptor);
+                if (old != null && old != descriptor) {
+                    throw new EJBQLException(
+                            "Duplicate identification variable definition: "
+                                    + aliasId
+                                    + ", it is already used for "
+                                    + old.getEntity().getName());
+                }
+
+                incomingById.put(aliasId, incoming);
+
+                id = null;
+                descriptor = null;
+                incoming = null;
+            }
+
+            return true;
+        }
+    }
+
+    class WhereClauseVisitor extends EJBQLBaseVisitor {
+        // TODO: andrus 4/9/2007 - load implicit joins
+    }
+
+    class SelectExpressionVisitor extends EJBQLBaseVisitor {
+
+        public boolean visitIdentifier(EJBQLExpression expression) {
+            rootId = expression.getText();
+            return true;
+        }
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbs.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbs.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbs.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbs.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAbs(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAbs(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbstractSchemaName.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbstractSchemaName.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbstractSchemaName.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAbstractSchemaName.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAbstractSchemaName(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAbstractSchemaName(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAdd.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAdd.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAdd.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAdd.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAdd(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAdd(this, -1);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAggregate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAggregate.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAggregate.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAggregate.java Mon Apr  9 02:54:53 2007
@@ -26,14 +26,10 @@
  */
 public class EJBQLAggregate extends SimpleNode {
 
-	public EJBQLAggregate(int id) {
-		super(id);
-	}
-
-    EJBQLAggregate(AbstractParser parser, int id) {
+    public EJBQLAggregate(int id) {
         super(id);
     }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAggregate(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAll.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAll.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAll.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAll.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAll(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAll(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAnd.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAnd.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAnd.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAnd.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAnd(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAnd(this, -1);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAny.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAny.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAny.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAny.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLAny(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAny(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAscending.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAscending.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAscending.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAscending.java Mon Apr  9 02:54:53 2007
@@ -25,14 +25,11 @@
  * @author Andrus Adamchik
  */
 public class EJBQLAscending extends SimpleNode {
-	public EJBQLAscending(int id) {
-		super(id);
-	}
-    
-    EJBQLAscending(AbstractParser parser, int id) {
+
+    public EJBQLAscending(int id) {
         super(id);
     }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAscending(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAverage.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAverage.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAverage.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLAverage.java Mon Apr  9 02:54:53 2007
@@ -29,11 +29,7 @@
     public EJBQLAverage(int id) {
         super(id);
     }
-    
-    EJBQLAverage(AbstractParser parser, int id) {
-        super(id);
-    }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitAverage(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBetween.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBetween.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBetween.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBetween.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLBetween(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitBetween(this, -1);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBooleanLiteral.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBooleanLiteral.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBooleanLiteral.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLBooleanLiteral.java Mon Apr  9 02:54:53 2007
@@ -25,14 +25,11 @@
  * @author Andrus Adamchik
  */
 public class EJBQLBooleanLiteral extends SimpleNode {
-	public EJBQLBooleanLiteral(int id) {
-		super(id);
-	}
-    
-    EJBQLBooleanLiteral(AbstractParser parser, int id) {
+
+    public EJBQLBooleanLiteral(int id) {
         super(id);
     }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitBooleanLiteral(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLClassName.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLClassName.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLClassName.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLClassName.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLClassName(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitClassName(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConcat.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConcat.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConcat.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConcat.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLConcat(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitConcat(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructor.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructor.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructor.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLConstructor(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitConstructor(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameter.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameter.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameter.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLConstructorParameter(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitConstructorParameter(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameters.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameters.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameters.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLConstructorParameters.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLConstructorParameters(AbstractParser parser, int id) {
-        super(id);
-    }
-
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitConstructorParameters(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCount.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCount.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCount.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCount.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLCount(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitCount(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentDate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentDate.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentDate.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentDate.java Mon Apr  9 02:54:53 2007
@@ -30,10 +30,6 @@
         super(id);
     }
 
-    EJBQLCurrentDate(AbstractParser parser, int id) {
-        super(id);
-    }
-    
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitCurrentDate(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTime.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTime.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTime.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTime.java Mon Apr  9 02:54:53 2007
@@ -25,14 +25,11 @@
  * @author Andrus Adamchik
  */
 public class EJBQLCurrentTime extends SimpleNode {
-	public EJBQLCurrentTime(int id) {
-		super(id);
-	}
-    
-    EJBQLCurrentTime(AbstractParser parser, int id) {
+
+    public EJBQLCurrentTime(int id) {
         super(id);
     }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitCurrentTime(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTimestamp.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTimestamp.java?view=diff&rev=526696&r1=526695&r2=526696
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTimestamp.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/EJBQLCurrentTimestamp.java Mon Apr  9 02:54:53 2007
@@ -25,14 +25,11 @@
  * @author Andrus Adamchik
  */
 public class EJBQLCurrentTimestamp extends SimpleNode {
-	public EJBQLCurrentTimestamp(int id) {
-		super(id);
-	}
-    
-    EJBQLCurrentTimestamp(AbstractParser parser, int id) {
+
+    public EJBQLCurrentTimestamp(int id) {
         super(id);
     }
-    
+
     protected boolean visitNode(EJBQLExpressionVisitor visitor) {
         return visitor.visitCurrentTimestamp(this);
     }



Mime
View raw message