cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r517136 [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/java/org/apache/cayenne/query/ ma...
Date Mon, 12 Mar 2007 09:00:34 GMT
Author: aadamchik
Date: Mon Mar 12 02:00:29 2007
New Revision: 517136

URL: http://svn.apache.org/viewvc?view=rev&rev=517136
Log:
CAY-452: EJB QL Cayenne Query
visitor API is set, basic query wiring is in place. EJBQL like "select a from Artist a" works already

Added:
    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/query/EJBQLConditionTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLFromTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLPathVisitor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLSelectColumnsTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLSelectOrderByTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLSelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/access/DataContextEJBQLQueryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/resources/dml/access.DataContextEJBQLQueryTest.xml
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ResultDirective.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/EJBQLExpressionVisitor.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.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/java/org/apache/cayenne/ejbql/parser/SimpleNode.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/EJBQLTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/ObjectIdQuery.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/ejbql/EJBQLCompiledExpressionTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/query/EJBQLTranslatorTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ResultDirective.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ResultDirective.java?view=diff&rev=517136&r1=517135&r2=517136
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ResultDirective.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/access/jdbc/ResultDirective.java Mon Mar 12 02:00:29 2007
@@ -17,7 +17,6 @@
  *  under the License.
  ****************************************************************/
 
-
 package org.apache.cayenne.access.jdbc;
 
 import java.io.IOException;
@@ -40,24 +39,26 @@
 import org.apache.cayenne.util.Util;
 
 /**
- * A custom Velocity directive to describe a ResultSet column.
- * There are the following possible invocation formats inside the template:
+ * A custom Velocity directive to describe a ResultSet column. There are the following
+ * possible invocation formats inside the template:
  * 
  * <pre>
- * #result(column_name) - e.g. #result('ARTIST_ID')
- * #result(column_name java_type) - e.g. #result('ARTIST_ID' 'String')
- * #result(column_name java_type column_alias) - e.g. #result('ARTIST_ID' 'String' 'ID')
- * #result(column_name java_type column_alias data_row_key) - e.g. #result('ARTIST_ID' 'String' 'ID' 'toArtist.ID')
+ *      #result(column_name) - e.g. #result('ARTIST_ID')
+ *      #result(column_name java_type) - e.g. #result('ARTIST_ID' 'String')
+ *      #result(column_name java_type column_alias) - e.g. #result('ARTIST_ID' 'String' 'ID')
+ *      #result(column_name java_type column_alias data_row_key) - e.g. #result('ARTIST_ID' 'String' 'ID' 'toArtist.ID')
  * </pre>
  * 
- * <p>'data_row_key' is needed if SQL 'column_alias' is not appropriate as a DataRow key on the Cayenne
- * side. One common case when this happens is when a DataRow retrieved from a query is mapped
- * using joint prefetch keys. In this case DataRow must use DB_PATH expressions for joint column keys,
- * and their format is incompatible with most databases alias format.</p>
- * 
- * <p>Most common Java types used in JDBC can be specified without 
- * a package. This includes all numeric types, primitives, String, SQL dates, BigDecimal
- * and BigInteger.
+ * <p>
+ * 'data_row_key' is needed if SQL 'column_alias' is not appropriate as a DataRow key on
+ * the Cayenne side. One common case when this happens is when a DataRow retrieved from a
+ * query is mapped using joint prefetch keys. In this case DataRow must use DB_PATH
+ * expressions for joint column keys, and their format is incompatible with most databases
+ * alias format.
+ * </p>
+ * <p>
+ * Most common Java types used in JDBC can be specified without a package. This includes
+ * all numeric types, primitives, String, SQL dates, BigDecimal and BigInteger.
  * </p>
  * 
  * @author Andrus Adamchik
@@ -106,10 +107,7 @@
     }
 
     public boolean render(InternalContextAdapter context, Writer writer, Node node)
-        throws
-            IOException,
-            ResourceNotFoundException,
-            ParseErrorException,
+            throws IOException, ResourceNotFoundException, ParseErrorException,
             MethodInvocationException {
 
         String column = getChildAsString(context, node, 0);
@@ -122,24 +120,27 @@
 
         String alias = getChildAsString(context, node, 2);
         String dataRowKey = getChildAsString(context, node, 3);
-        
+
         // determine what we want to name this column in a resulting DataRow...
         String label = (!Util.isEmptyString(dataRowKey)) ? dataRowKey : (!Util
                 .isEmptyString(alias)) ? alias : null;
-  
 
         ColumnDescriptor columnDescriptor = new ColumnDescriptor();
         columnDescriptor.setName(column);
         columnDescriptor.setLabel(label);
-  
+
         String type = getChildAsString(context, node, 1);
         if (type != null) {
             columnDescriptor.setJavaClass(guessType(type.toString()));
         }
 
         writer.write(column);
-        
-        // append alias if needed
+
+        // append column alias if needed.
+
+        // Note that if table aliases are used, this logic will result in SQL like
+        // "t0.ARTIST_NAME AS ARTIST_NAME". Doing extra regex matching to handle this
+        // won't probably buy us much.
         if (!Util.isEmptyString(alias) && !alias.equals(column)) {
             writer.write(" AS ");
             writer.write(alias);
@@ -150,14 +151,13 @@
     }
 
     protected Object getChild(InternalContextAdapter context, Node node, int i)
-        throws MethodInvocationException {
-        return (i >= 0 && i < node.jjtGetNumChildren())
-            ? node.jjtGetChild(i).value(context)
-            : null;
+            throws MethodInvocationException {
+        return (i >= 0 && i < node.jjtGetNumChildren()) ? node.jjtGetChild(i).value(
+                context) : null;
     }
-    
+
     /**
-     * Returns a directive argument at a given index converted to String. 
+     * Returns a directive argument at a given index converted to String.
      * 
      * @since 1.2
      */
@@ -168,9 +168,9 @@
     }
 
     /**
-     * Converts "short" type notation to the fully qualified class name.
-     * Right now supports all major standard SQL types, including primitives.
-     * All other types are expected to be fully qualified, and are not converted.
+     * Converts "short" type notation to the fully qualified class name. Right now
+     * supports all major standard SQL types, including primitives. All other types are
+     * expected to be fully qualified, and are not converted.
      */
     protected String guessType(String type) {
         String guessed = (String) typesGuess.get(type);
@@ -181,11 +181,10 @@
      * Adds value to the list of result columns in the context.
      */
     protected void bindResult(
-        InternalContextAdapter context,
-        ColumnDescriptor columnDescriptor) {
+            InternalContextAdapter context,
+            ColumnDescriptor columnDescriptor) {
 
-        Collection resultColumns =
-            (Collection) context.getInternalUserContext().get(
+        Collection resultColumns = (Collection) context.getInternalUserContext().get(
                 SQLTemplateProcessor.RESULT_COLUMNS_LIST_KEY);
 
         if (resultColumns != null) {

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -19,35 +19,369 @@
 package org.apache.cayenne.ejbql;
 
 /**
- * A noop implementation of the EJBQL visitor that returns true from all methods. Intended
- * for subclassing.
+ * A noop implementation of the EJBQL visitor that returns same preset boolean value from
+ * all methods. Intended for subclassing.
  * 
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLBaseVisitor implements EJBQLExpressionVisitor {
 
+    protected boolean continueFlag;
+
+    public EJBQLBaseVisitor() {
+        this(true);
+    }
+
+    public EJBQLBaseVisitor(boolean continueFlag) {
+        this.continueFlag = continueFlag;
+    }
+
+    public boolean visitAbs(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAbstractSchemaName(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAdd(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitAggregate(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAll(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAnd(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitAny(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAscending(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitAverage(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitBetween(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitBooleanLiteral(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitClassName(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitConcat(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitConstructor(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitConstructorParameter(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitConstructorParameters(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitCount(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitCurrentDate(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitCurrentTime(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitCurrentTimestamp(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDecimalLiteral(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDelete(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDescending(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDistinct(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDistinctPath(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitDivide(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitEquals(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitEscapeCharacter(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitExists(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
     public boolean visitFrom(EJBQLExpression expression) {
-        return true;
+        return continueFlag;
+    }
+
+    public boolean visitFromItem(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitGreaterOrEqual(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitGreaterThan(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitGroupBy(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitHaving(EJBQLExpression expression) {
+        return continueFlag;
     }
 
     public boolean visitIdentificationVariable(EJBQLExpression expression) {
-        return true;
+        return continueFlag;
+    }
+
+    public boolean visitIdentifier(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitIn(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitInnerFetchJoin(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitInnerJoin(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitIntegerLiteral(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitIsEmpty(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitIsNull(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitLength(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitLessOrEqual(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitLessThan(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitLike(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitLocate(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitLower(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitMax(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitMemberOf(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitMin(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitMod(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitMultiply(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitNamedInputParameter(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitNegative(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitNot(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitNotEquals(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitOr(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitOrderBy(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitOrderByItem(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitOuterFetchJoin(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitOuterJoin(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitPath(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitPatternValue(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitPositionalInputParameter(EJBQLExpression expression) {
+        return continueFlag;
     }
 
     public boolean visitSelect(EJBQLExpression expression) {
-        return true;
+        return continueFlag;
     }
 
     public boolean visitSelectExpression(EJBQLExpression expression) {
-        return true;
+        return continueFlag;
     }
-    
-    public boolean visitFromItem(EJBQLExpression expression) {
-        return true;
+
+    public boolean visitSize(EJBQLExpression expression) {
+        return continueFlag;
     }
-    
-    public boolean visitAbstractSchemaName(EJBQLExpression expression) {
-        return true;
+
+    public boolean visitSqrt(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitStringLiteral(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitSubselect(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitSubstring(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitSubtract(EJBQLExpression expression, int finishedChildIndex) {
+        return continueFlag;
+    }
+
+    public boolean visitSum(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTok(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTrim(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTrimBoth(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTrimCharacter(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTrimLeading(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitTrimTrailing(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitUpdate(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitUpdateField(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitUpdateItem(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitUpdateValue(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitUpper(EJBQLExpression expression) {
+        return continueFlag;
+    }
+
+    public boolean visitWhere(EJBQLExpression expression) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -34,10 +34,16 @@
     EJBQLExpression getExpression();
 
     /**
+     * Returns a descriptor of the root of this expression such as entity being fetched or
+     * updated.
+     */
+    ClassDescriptor getRootDescriptor();
+
+    /**
      * Returns a ClassDescriptor for the id variable.
      */
-    ClassDescriptor getEntityDescriptor(String idVariable);
-    
+    ClassDescriptor getEntityDescriptor(String identifier);
+
     /**
      * Returns EJB QL source of the compiled expression if available.
      */

Added: 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=auto&rev=517136
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java (added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/EJBQLDelegatingVisitor.java Mon Mar 12 02:00:29 2007
@@ -0,0 +1,420 @@
+/*****************************************************************
+ *   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;
+
+/**
+ * A base implementation of the EJBQLExpressionVisitor that implements all methods to
+ * delegate processing to another visitor. This is a convenience superclass for visitors
+ * that delegate processing of subtrees to child visitors.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+public class EJBQLDelegatingVisitor implements EJBQLExpressionVisitor {
+
+    protected EJBQLExpressionVisitor delegate;
+
+    protected void setDelegate(EJBQLExpressionVisitor delegate) {
+        this.delegate = delegate;
+    }
+
+    protected EJBQLExpressionVisitor getDelegate() {
+        return delegate;
+    }
+
+    public boolean visitAbs(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAbs(expression) : false;
+    }
+
+    public boolean visitAbstractSchemaName(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAbstractSchemaName(expression) : false;
+    }
+
+    public boolean visitAdd(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitAdd(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitAggregate(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAggregate(expression) : false;
+    }
+
+    public boolean visitAll(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAll(expression) : false;
+    }
+
+    public boolean visitAnd(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitAnd(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitAny(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAny(expression) : false;
+    }
+
+    public boolean visitAscending(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAscending(expression) : false;
+    }
+
+    public boolean visitAverage(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitAverage(expression) : false;
+    }
+
+    public boolean visitBetween(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitBetween(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitBooleanLiteral(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitBooleanLiteral(expression) : false;
+    }
+
+    public boolean visitClassName(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitClassName(expression) : false;
+    }
+
+    public boolean visitConcat(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitConcat(expression) : false;
+    }
+
+    public boolean visitConstructor(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitConstructor(expression) : false;
+    }
+
+    public boolean visitConstructorParameter(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitConstructorParameter(expression) : false;
+    }
+
+    public boolean visitConstructorParameters(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitConstructorParameters(expression) : false;
+    }
+
+    public boolean visitCount(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitCount(expression) : false;
+    }
+
+    public boolean visitCurrentDate(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitCurrentDate(expression) : false;
+    }
+
+    public boolean visitCurrentTime(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitCurrentTime(expression) : false;
+    }
+
+    public boolean visitCurrentTimestamp(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitCurrentTimestamp(expression) : false;
+    }
+
+    public boolean visitDecimalLiteral(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitDecimalLiteral(expression) : false;
+    }
+
+    public boolean visitDelete(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitDelete(expression) : false;
+    }
+
+    public boolean visitDescending(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitDescending(expression) : false;
+    }
+
+    public boolean visitDistinct(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitDistinct(expression) : false;
+    }
+
+    public boolean visitDistinctPath(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitDistinctPath(expression) : false;
+    }
+
+    public boolean visitDivide(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitDivide(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitEquals(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitEquals(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitEscapeCharacter(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitEscapeCharacter(expression) : false;
+    }
+
+    public boolean visitExists(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitExists(expression) : false;
+    }
+
+    public boolean visitFrom(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitFrom(expression) : false;
+    }
+
+    public boolean visitFromItem(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitFromItem(expression) : false;
+    }
+
+    public boolean visitGreaterOrEqual(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null ? delegate.visitGreaterOrEqual(
+                expression,
+                finishedChildIndex) : false;
+    }
+
+    public boolean visitGreaterThan(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null ? delegate.visitGreaterThan(
+                expression,
+                finishedChildIndex) : false;
+    }
+
+    public boolean visitGroupBy(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitGroupBy(expression) : false;
+    }
+
+    public boolean visitHaving(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitHaving(expression) : false;
+    }
+
+    public boolean visitIdentificationVariable(EJBQLExpression expression) {
+        return delegate != null
+                ? delegate.visitIdentificationVariable(expression)
+                : false;
+    }
+
+    public boolean visitIdentifier(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitIdentifier(expression) : false;
+    }
+
+    public boolean visitIn(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitIn(expression) : false;
+    }
+
+    public boolean visitInnerFetchJoin(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitInnerFetchJoin(expression) : false;
+    }
+
+    public boolean visitInnerJoin(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitInnerJoin(expression) : false;
+    }
+
+    public boolean visitIntegerLiteral(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitIntegerLiteral(expression) : false;
+    }
+
+    public boolean visitIsEmpty(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitIsEmpty(expression) : false;
+    }
+
+    public boolean visitIsNull(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitIsNull(expression) : false;
+    }
+
+    public boolean visitLength(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitLength(expression) : false;
+    }
+
+    public boolean visitLessOrEqual(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null ? delegate.visitLessOrEqual(
+                expression,
+                finishedChildIndex) : false;
+    }
+
+    public boolean visitLessThan(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitLessThan(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitLike(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitLike(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitLocate(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitLocate(expression) : false;
+    }
+
+    public boolean visitLower(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitLower(expression) : false;
+    }
+
+    public boolean visitMax(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitMax(expression) : false;
+    }
+
+    public boolean visitMemberOf(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitMemberOf(expression) : false;
+    }
+
+    public boolean visitMin(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitMin(expression) : false;
+    }
+
+    public boolean visitMod(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitMod(expression) : false;
+    }
+
+    public boolean visitMultiply(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitMultiply(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitNamedInputParameter(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitNamedInputParameter(expression) : false;
+    }
+
+    public boolean visitNegative(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitNegative(expression) : false;
+    }
+
+    public boolean visitNot(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitNot(expression) : false;
+    }
+
+    public boolean visitNotEquals(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitNotEquals(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitOr(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitOr(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitOrderBy(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitOrderBy(expression) : false;
+    }
+
+    public boolean visitOrderByItem(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitOrderByItem(expression) : false;
+    }
+
+    public boolean visitOuterFetchJoin(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitOuterFetchJoin(expression) : false;
+    }
+
+    public boolean visitOuterJoin(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitOuterJoin(expression) : false;
+    }
+
+    public boolean visitPath(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitPath(expression) : false;
+    }
+
+    public boolean visitPatternValue(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitPatternValue(expression) : false;
+    }
+
+    public boolean visitPositionalInputParameter(EJBQLExpression expression) {
+        return delegate != null
+                ? delegate.visitPositionalInputParameter(expression)
+                : false;
+    }
+
+    public boolean visitSelect(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSelect(expression) : false;
+    }
+
+    public boolean visitSelectExpression(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSelectExpression(expression) : false;
+    }
+
+    public boolean visitSize(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSize(expression) : false;
+    }
+
+    public boolean visitSqrt(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSqrt(expression) : false;
+    }
+
+    public boolean visitStringLiteral(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitStringLiteral(expression) : false;
+    }
+
+    public boolean visitSubselect(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSubselect(expression) : false;
+    }
+
+    public boolean visitSubstring(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSubstring(expression) : false;
+    }
+
+    public boolean visitSubtract(EJBQLExpression expression, int finishedChildIndex) {
+        return delegate != null
+                ? delegate.visitSubtract(expression, finishedChildIndex)
+                : false;
+    }
+
+    public boolean visitSum(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitSum(expression) : false;
+    }
+
+    public boolean visitTok(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTok(expression) : false;
+    }
+
+    public boolean visitTrim(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTrim(expression) : false;
+    }
+
+    public boolean visitTrimBoth(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTrimBoth(expression) : false;
+    }
+
+    public boolean visitTrimCharacter(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTrimCharacter(expression) : false;
+    }
+
+    public boolean visitTrimLeading(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTrimLeading(expression) : false;
+    }
+
+    public boolean visitTrimTrailing(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitTrimTrailing(expression) : false;
+    }
+
+    public boolean visitUpdate(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitUpdate(expression) : false;
+    }
+
+    public boolean visitUpdateField(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitUpdateField(expression) : false;
+    }
+
+    public boolean visitUpdateItem(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitUpdateItem(expression) : false;
+    }
+
+    public boolean visitUpdateValue(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitUpdateValue(expression) : false;
+    }
+
+    public boolean visitUpper(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitUpper(expression) : false;
+    }
+
+    public boolean visitWhere(EJBQLExpression expression) {
+        return delegate != null ? delegate.visitWhere(expression) : false;
+    }
+}

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -26,15 +26,294 @@
  */
 public interface EJBQLExpressionVisitor {
 
-    boolean visitSelect(EJBQLExpression expression);
+    boolean visitAbs(EJBQLExpression expression);
 
-    boolean visitFrom(EJBQLExpression expression);
+    boolean visitAbstractSchemaName(EJBQLExpression expression);
 
-    boolean visitSelectExpression(EJBQLExpression expression);
+    /**
+     * Called on visiting "add" expression and also after visiting every expression child.
+     * 
+     * @param expression an "add" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitAdd(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitAggregate(EJBQLExpression expression);
+
+    boolean visitAll(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "and" expression and also after visiting every expression child.
+     * 
+     * @param expression an "and" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitAnd(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitAny(EJBQLExpression expression);
+
+    boolean visitAscending(EJBQLExpression expression);
+
+    boolean visitAverage(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "between" expression and also after visiting every expression
+     * child.
+     * 
+     * @param expression an "between" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitBetween(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitBooleanLiteral(EJBQLExpression expression);
+
+    boolean visitClassName(EJBQLExpression expression);
+
+    boolean visitConcat(EJBQLExpression expression);
+
+    boolean visitConstructor(EJBQLExpression expression);
+
+    boolean visitConstructorParameter(EJBQLExpression expression);
+
+    boolean visitConstructorParameters(EJBQLExpression expression);
+
+    boolean visitCount(EJBQLExpression expression);
+
+    boolean visitCurrentDate(EJBQLExpression expression);
+
+    boolean visitCurrentTime(EJBQLExpression expression);
+
+    boolean visitCurrentTimestamp(EJBQLExpression expression);
+
+    boolean visitDecimalLiteral(EJBQLExpression expression);
+
+    boolean visitDelete(EJBQLExpression expression);
+
+    boolean visitDescending(EJBQLExpression expression);
+
+    boolean visitDistinct(EJBQLExpression expression);
+
+    boolean visitDistinctPath(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "divide" expression and also after visiting every expression
+     * child.
+     * 
+     * @param expression an "divide" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitDivide(EJBQLExpression expression, int finishedChildIndex);
+
+    /**
+     * Called on visiting "equals" expression and also after visiting every expression
+     * child.
+     * 
+     * @param expression an "equals" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitEquals(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitEscapeCharacter(EJBQLExpression expression);
+
+    boolean visitExists(EJBQLExpression expression);
+
+    boolean visitFrom(EJBQLExpression expression);
 
     boolean visitFromItem(EJBQLExpression expression);
 
+    /**
+     * Called on visiting ">=" expression and also after visiting every expression child.
+     * 
+     * @param expression an ">=" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitGreaterOrEqual(EJBQLExpression expression, int finishedChildIndex);
+
+    /**
+     * Called on visiting ">=" expression and also after visiting every expression child.
+     * 
+     * @param expression an ">=" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitGreaterThan(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitGroupBy(EJBQLExpression expression);
+
+    boolean visitHaving(EJBQLExpression expression);
+
     boolean visitIdentificationVariable(EJBQLExpression expression);
 
-    boolean visitAbstractSchemaName(EJBQLExpression expression);
+    boolean visitIdentifier(EJBQLExpression expression);
+
+    boolean visitIn(EJBQLExpression expression);
+
+    boolean visitInnerFetchJoin(EJBQLExpression expression);
+
+    boolean visitInnerJoin(EJBQLExpression expression);
+
+    boolean visitIntegerLiteral(EJBQLExpression expression);
+
+    boolean visitIsEmpty(EJBQLExpression expression);
+
+    boolean visitIsNull(EJBQLExpression expression);
+
+    boolean visitLength(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "<=" expression and also after visiting every expression child.
+     * 
+     * @param expression an "<=" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitLessOrEqual(EJBQLExpression expression, int finishedChildIndex);
+
+    /**
+     * Called on visiting "<" expression and also after visiting every expression child.
+     * 
+     * @param expression an "<" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitLessThan(EJBQLExpression expression, int finishedChildIndex);
+
+    /**
+     * Called on visiting "LIKE" expression and also after visiting every expression
+     * child.
+     * 
+     * @param expression an "LIKE" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitLike(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitLocate(EJBQLExpression expression);
+
+    boolean visitLower(EJBQLExpression expression);
+
+    boolean visitMax(EJBQLExpression expression);
+
+    boolean visitMemberOf(EJBQLExpression expression);
+
+    boolean visitMin(EJBQLExpression expression);
+
+    boolean visitMod(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "*" expression and also after visiting every expression child.
+     * 
+     * @param expression an "*" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitMultiply(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitNamedInputParameter(EJBQLExpression expression);
+
+    boolean visitNegative(EJBQLExpression expression);
+
+    boolean visitNot(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "!=" expression and also after visiting every expression child.
+     * 
+     * @param expression an "!=" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitNotEquals(EJBQLExpression expression, int finishedChildIndex);
+
+    /**
+     * Called on visiting "or" expression and also after visiting every expression child.
+     * 
+     * @param expression an "or" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitOr(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitOrderBy(EJBQLExpression expression);
+
+    boolean visitOrderByItem(EJBQLExpression expression);
+
+    boolean visitOuterFetchJoin(EJBQLExpression expression);
+
+    boolean visitOuterJoin(EJBQLExpression expression);
+
+    boolean visitPath(EJBQLExpression expression);
+
+    boolean visitPatternValue(EJBQLExpression expression);
+
+    boolean visitPositionalInputParameter(EJBQLExpression expression);
+
+    boolean visitSelect(EJBQLExpression expression);
+
+    boolean visitSelectExpression(EJBQLExpression expression);
+
+    boolean visitSize(EJBQLExpression expression);
+
+    boolean visitSqrt(EJBQLExpression expression);
+
+    boolean visitStringLiteral(EJBQLExpression expression);
+
+    boolean visitSubselect(EJBQLExpression expression);
+
+    boolean visitSubstring(EJBQLExpression expression);
+
+    /**
+     * Called on visiting "subtract" expression and also after visiting every expression
+     * child.
+     * 
+     * @param expression an "subtract" node being visited.
+     * @param finishedChildIndex "-1" when the expression node is visited for the first
+     *            time, before its children; otherwise this is an index of a child just
+     *            visited.
+     */
+    boolean visitSubtract(EJBQLExpression expression, int finishedChildIndex);
+
+    boolean visitSum(EJBQLExpression expression);
+
+    boolean visitTok(EJBQLExpression expression);
+
+    boolean visitTrim(EJBQLExpression expression);
+
+    boolean visitTrimBoth(EJBQLExpression expression);
+
+    boolean visitTrimCharacter(EJBQLExpression expression);
+
+    boolean visitTrimLeading(EJBQLExpression expression);
+
+    boolean visitTrimTrailing(EJBQLExpression expression);
+
+    boolean visitUpdate(EJBQLExpression expression);
+    
+    boolean visitUpdateField(EJBQLExpression expression);
+    
+    boolean visitUpdateItem(EJBQLExpression expression);
+    
+    boolean visitUpdateValue(EJBQLExpression expression);
+    
+    boolean visitUpper(EJBQLExpression expression);
+
+    boolean visitWhere(EJBQLExpression expression);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.java?view=diff&rev=517136&r1=517135&r2=517136
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/ejbql/parser/AbstractParser.java Mon Mar 12 02:00:29 2007
@@ -20,8 +20,10 @@
 
 import java.util.Map;
 
+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.map.EntityResolver;
 import org.apache.cayenne.reflect.ClassDescriptor;
 
@@ -34,16 +36,32 @@
  */
 abstract class AbstractParser {
 
-     Map descriptorsById;
-     EntityResolver resolver;
-     String source;
+    Map descriptorsById;
+    EntityResolver resolver;
+    String source;
+    String rootId;
 
+    private EJBQLExpressionVisitor rootDescriptorVisitor;
 
     private final boolean callbacksEnabled() {
         return resolver != null;
     }
 
-    void fromItemLoaded(EJBQLExpression expression) {
+    void selectExpressionLoaded(EJBQLSelectExpression expression) {
+        if (rootDescriptorVisitor == null) {
+            rootDescriptorVisitor = new EJBQLBaseVisitor() {
+
+                public boolean visitIdentifier(EJBQLExpression expression) {
+                    rootId = expression.getText();
+                    return true;
+                }
+            };
+        }
+
+        expression.visit(rootDescriptorVisitor);
+    }
+
+    void fromItemLoaded(EJBQLFromItem expression) {
 
         if (!callbacksEnabled()) {
             return;
@@ -55,8 +73,7 @@
         }
 
         // TODO: andrus, 2/28/2007 - resolve path ... for now only support direct
-        // entity
-        // names
+        // entity names
         EJBQLExpression abstractSchemaName = expression.getChild(0);
         String schemaName = abstractSchemaName.getChild(0).getText();
 

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -33,6 +33,7 @@
 class CompiledExpression implements EJBQLCompiledExpression {
 
     private String source;
+    private String rootId;
     private Map descriptorsById;
     private EJBQLExpression expression;
 
@@ -46,6 +47,10 @@
 
         return (ClassDescriptor) descriptorsById.get(idVariable);
     }
+    
+    public ClassDescriptor getRootDescriptor() {
+        return rootId != null ? getEntityDescriptor(rootId) : null;
+    }
 
     public EJBQLExpression getExpression() {
         return expression;
@@ -65,5 +70,9 @@
 
     void setSource(String source) {
         this.source = source;
+    }
+    
+    void setRootId(String rootId) {
+        this.rootId = rootId;
     }
 }

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -26,5 +28,13 @@
 
     public EJBQLAbs(int id) {
         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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -30,7 +30,11 @@
         super(id);
     }
 
-    protected boolean nonRecursiveVisit(EJBQLExpressionVisitor visitor) {
+    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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,13 +18,28 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLAdd extends SimpleNode {
 
-	public EJBQLAdd(int id) {
-		super(id);
-	}
+    public EJBQLAdd(int id) {
+        super(id);
+    }
+
+    EJBQLAdd(AbstractParser parser, int id) {
+        super(id);
+    }
+
+    protected boolean visitNode(EJBQLExpressionVisitor visitor) {
+        return visitor.visitAdd(this, -1);
+    }
+
+    protected boolean visitChild(EJBQLExpressionVisitor visitor, int childIndex) {
+        return super.visitChild(visitor, childIndex)
+                && visitor.visitAdd(this, childIndex);
+    }
 }

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -28,4 +30,11 @@
 		super(id);
 	}
 
+    EJBQLAggregate(AbstractParser parser, 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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,14 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLAll extends SimpleNode {
 
-	public EJBQLAll(int id) {
-		super(id);
-	}
+    public EJBQLAll(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,14 +18,28 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLAnd extends SimpleNode {
 
-	public EJBQLAnd(int id) {
-		super(id);
-	}
+    public EJBQLAnd(int id) {
+        super(id);
+    }
+
+    EJBQLAnd(AbstractParser parser, int id) {
+        super(id);
+    }
+
+    protected boolean visitNode(EJBQLExpressionVisitor visitor) {
+        return visitor.visitAnd(this, -1);
+    }
 
+    protected boolean visitChild(EJBQLExpressionVisitor visitor, int childIndex) {
+        return super.visitChild(visitor, childIndex)
+                && visitor.visitAnd(this, childIndex);
+    }
 }

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,14 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLAny extends SimpleNode {
 
-	public EJBQLAny(int id) {
-		super(id);
-	}
+    public EJBQLAny(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -26,4 +28,12 @@
 	public EJBQLAscending(int id) {
 		super(id);
 	}
+    
+    EJBQLAscending(AbstractParser parser, 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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -26,5 +28,13 @@
 
     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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,13 +18,28 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLBetween extends SimpleNode {
-	public EJBQLBetween(int id) {
-		super(id);
-	}
 
+    public EJBQLBetween(int id) {
+        super(id);
+    }
+
+    EJBQLBetween(AbstractParser parser, int id) {
+        super(id);
+    }
+
+    protected boolean visitNode(EJBQLExpressionVisitor visitor) {
+        return visitor.visitBetween(this, -1);
+    }
+
+    protected boolean visitChild(EJBQLExpressionVisitor visitor, int childIndex) {
+        return super.visitChild(visitor, childIndex)
+                && visitor.visitBetween(this, childIndex);
+    }
 }

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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -26,4 +28,12 @@
 	public EJBQLBooleanLiteral(int id) {
 		super(id);
 	}
+    
+    EJBQLBooleanLiteral(AbstractParser parser, 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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,13 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLClassName extends SimpleNode {
-	public EJBQLClassName(int id) {
-		super(id);
-	}
+
+    public EJBQLClassName(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -28,4 +30,11 @@
         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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
@@ -28,4 +30,11 @@
         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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,12 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLConstructorParameter extends SimpleNode {
-	public EJBQLConstructorParameter(int id) {
-		super(id);
-	}
+
+    public EJBQLConstructorParameter(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,12 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLConstructorParameters extends SimpleNode {
-	public EJBQLConstructorParameters(int id) {
-		super(id);
-	}
+
+    public EJBQLConstructorParameters(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,12 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLCount extends SimpleNode {
-	public EJBQLCount(int id) {
-		super(id);
-	}
+
+    public EJBQLCount(int id) {
+        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=517136&r1=517135&r2=517136
==============================================================================
--- 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 Mar 12 02:00:29 2007
@@ -18,12 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
+import org.apache.cayenne.ejbql.EJBQLExpressionVisitor;
+
 /**
  * @since 3.0
  * @author Andrus Adamchik
  */
 public class EJBQLCurrentDate extends SimpleNode {
-	public EJBQLCurrentDate(int id) {
-		super(id);
-	}
+
+    public EJBQLCurrentDate(int id) {
+        super(id);
+    }
+
+    EJBQLCurrentDate(AbstractParser parser, int id) {
+        super(id);
+    }
+    
+    protected boolean visitNode(EJBQLExpressionVisitor visitor) {
+        return visitor.visitCurrentDate(this);
+    }
 }



Mime
View raw message