Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 80870 invoked from network); 1 Apr 2007 16:30:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Apr 2007 16:30:47 -0000 Received: (qmail 47295 invoked by uid 500); 1 Apr 2007 16:30:54 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 47176 invoked by uid 500); 1 Apr 2007 16:30:54 -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 47167 invoked by uid 99); 1 Apr 2007 16:30:54 -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 09:30:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mprudhomapache@gmail.com designates 66.249.82.236 as permitted sender) Received: from [66.249.82.236] (HELO wx-out-0506.google.com) (66.249.82.236) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2007 09:30:46 -0700 Received: by wx-out-0506.google.com with SMTP id i26so1060594wxd for ; Sun, 01 Apr 2007 09:30:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=pg6fNEzLoGoFv+UaPPGh37UsjCGnSwfmRQsRAooylBZt0+T2P+BYX8FhAIg57awbYVOlK2kAVeq60MihDJKojlJjYyLvb+o4eiSqIJUkQTK0n0cKI6wUePSZX4PhcwgH+wCvGKKeOlWs+yBzYQkh2hM8p9RSabDQX1rDiiGR9bU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=LOkelUcyG6IFFsIp2k7SjeML8wB+9NwdNaRz2rpjQzkYPGge3bVdhcfXOZYtKvAs5ZpVtacrKZnUNxwarjzLww+m4VSfbT5F90e8vsDSlwXt3aa6zHSLzATPBRW18wdED3KCm//QKJkW/TQ8hvkIyyKxwmfkoIzg+lckyQWw/yQ= Received: by 10.70.65.8 with SMTP id n8mr7280756wxa.1175445025541; Sun, 01 Apr 2007 09:30:25 -0700 (PDT) Received: from ?192.168.1.65? ( [72.65.97.180]) by mx.google.com with ESMTP id h14sm5259900wxd.2007.04.01.09.30.24; Sun, 01 Apr 2007 09:30:25 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <111912D0-8DC3-4FE6-8D27-2BF1E476C02A@iq80.com> References: <111912D0-8DC3-4FE6-8D27-2BF1E476C02A@iq80.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <0DA24A0A-19D3-48EF-AFB2-363430178745@apache.org> Content-Transfer-Encoding: 7bit From: Marc Prud'hommeaux Subject: Re: [VOTE] ArgumentException : More parameters were passed to execute() than were declared Date: Sun, 1 Apr 2007 12:30:15 -0400 To: open-jpa-dev@incubator.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Marc Prud'hommeaux X-Virus-Checked: Checked by ClamAV on apache.org 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 >