Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0
-
None
Description
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 }