You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Patrick Linskey (JIRA)" <ji...@apache.org> on 2007/06/27 15:08:25 UTC

[jira] Commented: (OPENJPA-267) MethodQL unnecessarily requires a call to declareParameters()

    [ https://issues.apache.org/jira/browse/OPENJPA-267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508533 ] 

Patrick Linskey commented on OPENJPA-267:
-----------------------------------------

My earlier summary makes no sense at all in the context of MethodQL.

Digging into this further: maybe in MethodQL we should just not require parameters to be declared at all, and let the method impl do whatever param checks are necessary. Additionally, I do not believe that the result class setting should be required.

> 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.0, 0.9.6, 0.9.7
>            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 <e3...@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.