Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1539

IllegalArgumentException when input parameters for select is more than input parameters in EJB QL query

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: container system
    • Labels:
      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 }

        Attachments

        1. openejb-1539.patch
          0.9 kB
          Han Hong Fang

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hanhongfang Han Hong Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: