[
https://issues.apache.org/jira/browse/OPENJPA-267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Patrick Linskey updated OPENJPA-267:
------------------------------------
Fix Version/s: (was: 1.0.0)
> 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
>
> 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 <[EMAIL PROTECTED]> 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.