Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 89599 invoked from network); 5 Mar 2009 10:42:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2009 10:42:12 -0000 Received: (qmail 14671 invoked by uid 500); 5 Mar 2009 10:42:12 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 14444 invoked by uid 500); 5 Mar 2009 10:42:11 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 14433 invoked by uid 99); 5 Mar 2009 10:42:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Mar 2009 02:42:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.41.253.139] (HELO isp.logentis.net) (193.41.253.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Mar 2009 10:42:04 +0000 Received: from [192.168.170.10] (unknown [192.168.170.10]) by isp.logentis.net (Postfix) with ESMTP id 812FA29EB37 for ; Thu, 5 Mar 2009 11:41:42 +0100 (CET) Message-Id: From: Marc Logemann To: users@openjpa.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: MethodQL completely broken isnt it? Date: Thu, 5 Mar 2009 11:41:41 +0100 X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org Hi, since Filter Extension wont work as discussed, i wanted to use MethodQL as explained in Chapter 9 Section 5. I used mainly the same stuff explained in the docs: --- OpenJPAEntityManager oem = OpenJPAPersistence.cast(emf); OpenJPAQuery q = oem.createQuery("openjpa.MethodQL", "com.xyz.Finder.getByName"); // set the type of objects that the method returns q.setResultClass(Person.class); // parameters are passed the same way as in standard queries q.setParameter("firstName", "Fred").setParameter("lastName", "Lucas"); // this executes your method to get the results List results = q.getResultList(); --- First of all, when doin this, i am getting a complaint on parameters like that: org.apache.openjpa.persistence.ArgumentException: The parameter name or position "firstName" passed to execute() is not valid. All map keys must be a declared parameter name or a number matching the parameter position. Native queries only allow the use of positional parameters. Then i tried positional parameters like setParameter(1, "foo"); With that there is no exceptiom but the params parameter of the method signature s empty! public static ResultObjectProvider fooMethod(StoreContext ctx, ClassMetaData meta, boolean subclasses, Map params, FetchConfiguration fetch); Besides all this, i am wondering how to trigger the in-Memory Method exaplained in the docs later on. The method here has a different signature but somehow i must tell the query to use in-memory right? Otherwise the framework will always call the method siganture i showed above. So right now i am not being able to somehow reimplement my custom filter extension i used with Kodo back then. MethodQL was my only hope to solve all this. Please comment on these bugs.... if they are bugs but i dont know how to do something wrong here.... Marc