You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Han Hong Fang (JIRA)" <ji...@apache.org> on 2011/05/04 05:30:03 UTC
[jira] [Created] (OPENEJB-1539) IllegalArgumentException when input
parameters for select is more than input parameters in EJB QL query
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
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
[jira] [Updated] (OPENEJB-1539) IllegalArgumentException when input
parameters for select is more than input parameters in EJB QL query
Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENEJB-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Han Hong Fang updated OPENEJB-1539:
-----------------------------------
Fix Version/s: 4.0
> 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
[jira] [Updated] (OPENEJB-1539) IllegalArgumentException when input
parameters for select is more than input parameters in EJB QL query
Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENEJB-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Han Hong Fang updated OPENEJB-1539:
-----------------------------------
Attachment: openejb-1539.patch
Patch is attached, please help to review.
> 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
[jira] [Commented] (OPENEJB-1539) IllegalArgumentException when
input parameters for select is more than input parameters in EJB QL query
Posted by "Han Hong Fang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENEJB-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028573#comment-13028573 ]
Han Hong Fang commented on OPENEJB-1539:
----------------------------------------
More info:
According to JavaEE sdk API, in class javax.persistence.Query, method setParameter(int position, java.lang.Object value) throws java.lang.IllegalArgumentException - if position does not correspond to a positional parameter of the query or if the argument is of incorrect type
> 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
[jira] [Resolved] (OPENEJB-1539) IllegalArgumentException when
input parameters for select is more than input parameters in EJB QL query
Posted by "Ivan (JIRA)" <ji...@apache.org>.
[ 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