You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Ivan (JIRA)" <ji...@apache.org> on 2011/05/05 04:12:03 UTC

[jira] [Resolved] (OPENEJB-1539) IllegalArgumentException when input parameters for select is more than input parameters in EJB QL query

     [ https://issues.apache.org/jira/browse/OPENEJB-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan resolved OPENEJB-1539.
---------------------------

    Resolution: Fixed

Commit changes to trunk at revision: 1099664. Thanks, Han Hong Fang.

> IllegalArgumentException when input parameters for select is more than input parameters in EJB QL query
> -------------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-1539
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1539
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: container system
>    Affects Versions: 4.0
>            Reporter: Han Hong Fang
>             Fix For: 4.0
>
>         Attachments: openejb-1539.patch
>
>
> Following example shows the scenario that input parameters of select (which is three) is more than input paramters in EJB QL query (which is two).
>       <query>
>         <description></description>
>         <query-method>
>           <method-name>findBooks</method-name>
>           <method-params>
>             <method-param>java.lang.String</method-param>
>             <method-param>java.lang.String</method-param>
>             <method-param>java.lang.String</method-param>
>           </method-params>
>         </query-method>
>         <ejb-ql>SELECT object(c) from BookBean c WHERE c.title = ?2 AND c.author = ?3</ejb-ql>
>       </query>
> This is a valid scenario according to ejb3.1 spec section 9.2.6.4. 
> Currently,  
> Class JpaCmpEngine  ... {
> private List<Object> executeSelectQuery(Query query, Object[] args) {
> ...
> query.setParameter(i + 1, arg)    // this will throw  java.lang.IllegalArgumentException when i+1 = 1 since ?1 does exist in EJB QL
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira