Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 60904 invoked from network); 2 Apr 2007 05:07:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2007 05:07:35 -0000 Received: (qmail 91325 invoked by uid 500); 2 Apr 2007 05:07:41 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 91281 invoked by uid 500); 2 Apr 2007 05:07:41 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 91272 invoked by uid 99); 2 Apr 2007 05:07:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2007 22:07:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.42.249] (HELO nwk-ea-fw-1.sun.com) (192.18.42.249) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2007 22:07:32 -0700 Received: from d1-sfbay-09.sun.com ([192.18.39.119]) by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l3257Ah0026871 for ; Sun, 1 Apr 2007 22:07:12 -0700 (PDT) Received: from conversion-daemon.d1-sfbay-09.sun.com by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JFU00I01U1XVS00@d1-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for open-jpa-dev@incubator.apache.org; Sun, 01 Apr 2007 22:07:10 -0700 (PDT) Received: from [192.168.0.13] (c-24-6-172-77.hsd1.ca.comcast.net [24.6.172.77]) by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JFU00EG2U7X1D10@d1-sfbay-09.sun.com> for open-jpa-dev@incubator.apache.org; Sun, 01 Apr 2007 22:07:10 -0700 (PDT) Date: Sun, 01 Apr 2007 22:07:06 -0700 From: Craig L Russell Subject: Re: [VOTE] ArgumentException : More parameters were passed to execute() than were declared In-reply-to: <0DA24A0A-19D3-48EF-AFB2-363430178745@apache.org> Sender: Craig.Russell@Sun.COM To: open-jpa-dev@incubator.apache.org Message-id: MIME-version: 1.0 X-Mailer: Apple Mail (2.752.3) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-1--385268778; micalg=sha1 References: <111912D0-8DC3-4FE6-8D27-2BF1E476C02A@iq80.com> <0DA24A0A-19D3-48EF-AFB2-363430178745@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-1--385268778 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed +1 to remove the restriction. As long as no parameters are missing, the query should be considered sufficient. Craig On Apr 1, 2007, at 9:30 AM, Marc Prud'hommeaux wrote: > > Seem fair enough to get rid of the description. I've opened https:// > issues.apache.org/jira/browse/OPENJPA-196 describing the issue. > > +1 from me to remove the restriction that there be exactly as many > positional parameters declared as were assigned. > > > > On Mar 31, 2007, at 7:32 PM, Dain Sundstrom wrote: > >> Actually, I think there is a bigger problem... Say I have a query >> like this: >> >> SELECT x FROM foo AS x WHERE foo.name = ?2 >> >> The org.apache.openjpa.kernel.QueryImpl.assertParameters(...) code >> assumes that if I have 1 parameter it is numbered ?1, but in EJB >> 2.1 this was not a requirement and there are certification tests >> that verify you are allowed to have "unused" parameters (e.g, in >> my example about ?1 and ?N where N>2 are all not used). I >> couldn't find any text in the specification that says that all all >> positional parameters must be used in the query, but I did find >> text that say the EJB-QL 3.0 language is an extension of the EJB- >> QL 2.1 language: >> >> "The Java Persistence query language is an extension of the >> Enterprise Java Beans query language, EJB QL, definedin[5]." >> >> So I think we must remove the "extra-params" check, but I would be >> happy with a "don't check for extra-params flag". >> >> -dain >> >> On Mar 31, 2007, at 8:56 AM, Dain Sundstrom wrote: >> >>> I'm working on a CMP 2 implementation that delegates to OpenJPA >>> for persistence. I'm running into a problem where I get the >>> following exception: >>> >>> org.apache.openjpa.persistence.ArgumentException : More >>> parameters were passed to execute() than were declared: 4 >>> parameters were specified for query execution, but only 2 >>> parameters were declared in the query. >>> >>> >>> In CMP you declare finder and select methods that have parameters >>> which are passed into the query engine. You can have as many >>> parameters as you like but are not required to use them all, but >>> it appears that OpenJPA is enforcing a restriction where if the >>> EJB-QL text only lists say 2 parameters and I set 4 I get the >>> above exception. In order of perference: >>> >>> Is this spec required? If not, can we remove the check? >>> >>> Is there a way to disable the check? If so, how? >>> >>> Is there a way to determine the number of paramters a query >>> takes? If so, I can change my code. >>> >>> Is there a way to get the ejbql text from a Query object? If so, >>> I'll write a quick parser to determine number of queries myself. >>> >>> BTW, I'm currently using 0.9.6. >>> >>> Thanks, >>> >>> -dain >> > Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-1--385268778 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICECpJVMO68ii+Xfsc1O1YYFIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MTIwOTE5NTEwNVoXDTA3MTIwOTE5NTEw NVowbDEQMA4GA1UEBBMHUnVzc2Vsb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