From jdo-commits-return-1262-apmail-db-jdo-commits-archive=www.apache.org@db.apache.org Sat Feb 04 01:37:12 2006 Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 68910 invoked from network); 4 Feb 2006 01:37:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Feb 2006 01:37:12 -0000 Received: (qmail 49485 invoked by uid 500); 4 Feb 2006 01:37:11 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 49474 invoked by uid 99); 4 Feb 2006 01:37:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2006 17:37:11 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 03 Feb 2006 17:37:11 -0800 Received: (qmail 68854 invoked by uid 65534); 4 Feb 2006 01:36:50 -0000 Message-ID: <20060204013650.68853.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r374812 - /db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java Date: Sat, 04 Feb 2006 01:36:50 -0000 To: jdo-commits@db.apache.org From: clr@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: clr Date: Fri Feb 3 17:36:49 2006 New Revision: 374812 URL: http://svn.apache.org/viewcvs?rev=374812&view=rev Log: JDO-194 added query with implicitly defined variable name the same as a class name modulo capitalization Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java URL: http://svn.apache.org/viewcvs/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java?rev=374812&r1=374811&r2=374812&view=diff ============================================================================== --- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java (original) +++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java Fri Feb 3 17:36:49 2006 @@ -34,10 +34,16 @@ *Assertion ID: A14.6.5-4. *
*Assertion Description: - * Names are treated as variable names if they are explicitly declared - * via declareVariables. Otherwise, names are treated as field names - * if they are members of the candidate class. - * Finally, names are treated as implicitly defined variable names. + * Names in the filter are treated as parameters if they are explicitly + * declared via declareParameters or if they begin with ":". + * Names are treated as variable names if they are explicitly declared + * via declareVariables. + * Names are treated as field or property names if they are fields or + * properties of the candidate class. + * Names are treated as class names if they exist in the package of the + * candidate class, have been imported, or if they are in the java.lang + * package. e.g. Integer. + * Otherwise, names are treated as implicitly defined variable names. */ public class VariablesAndFields extends QueryTest { @@ -123,6 +129,23 @@ /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, + /*TO*/ null), + new QueryElementHolder( + /* Note: the variable name is the same as the class + * name except for capitalization. This is legal. */ + /*UNIQUE*/ null, + /*RESULT*/ null, + /*INTO*/ null, + /*FROM*/ Employee.class, + /*EXCLUDE*/ null, + /*WHERE*/ "team.contains(employee) & " + + "employee.firstname == 'emp1First'", + /*VARIABLES*/ null, + /*PARAMETERS*/ null, + /*IMPORTS*/ null, + /*GROUP BY*/ null, + /*ORDER BY*/ null, + /*FROM*/ null, /*TO*/ null) }; @@ -134,7 +157,8 @@ getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), - new LinkedList() + new LinkedList(), + getTransientCompanyModelInstancesAsList(new String[]{"emp2"}) }; /**