openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-267) MethodQL unnecessarily requires a call to declareParameters()
Date Wed, 27 Jun 2007 11:52:26 GMT
MethodQL unnecessarily requires a call to declareParameters()
-------------------------------------------------------------

                 Key: OPENJPA-267
                 URL: https://issues.apache.org/jira/browse/OPENJPA-267
             Project: OpenJPA
          Issue Type: Bug
          Components: query
    Affects Versions: 0.9.7, 0.9.6, 0.9.0
            Reporter: Patrick Linskey
             Fix For: 1.0.0


OpenJPA should be able to infer the parameters from the signature when there is no method
overloading, and in the case where there is method overloading, it'd be nice if OpenJPA would
allow the args specification to happen inline in the method declaration.

More context:

On 6/26/07, e33238 <e33238@hotmail.com> wrote:
> 
> I'm tracing through the code to find out what the problem was, and it seems
> that it'll work if I do this:
> 
> OpenJPAQuery q =
> oem.createQuery("openjpa.MethodQL","com.xyz.Finder.getByName");
> q.setResultClass(Person.class);
> q.setParameter("firstName", "Fred").setParameter("lastName", "Lucas");
> ((QueryImpl)q).getDelegate().declareParameters("String firstName, String
> lastName"); //<== additional line
> List results = q.getResultList();
> 
> Now getByName() will be called correctly, with "firstName" and "lastName" in
> the "params" map. I'm sure this is not the correct way, but I couldn't
> figure out how else I can call declareParameters(). Without calling
> declareParameters(), I'll get the ArgumentException.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message