1 Reply Latest reply on May 14, 2002 11:18 AM by dsundstrom

    Wrong finder EJB-QL because of arg type?

    wouterke

      Hi,

      I work with jboss3 RC2, jdk1.4, oracle 8.1.7, and have 2 finders, 1 works, and the other fails during deployment.

      Working finder:

      <query-method>
      <method-name>findByPaymentMethodDefinition</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Remote</result-type-mapping>
      <ejb-ql><![CDATA[SELECT OBJECT(c) FROM PaymentMethod c WHERE c.paymentMethodType = ?1]]></ejb-ql>


      Failing finder:

      <query-method>
      <method-name>findByPaymentMethodDefinition</method-name>
      <method-params>
      <method-param>java.math.BigDecimal</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Remote</result-type-mapping>
      <ejb-ql><![CDATA[SELECT OBJECT(c) FROM PaymentMethod c WHERE c.customerID = ?1]]></ejb-ql>


      Error is:
      Error compiling ejb-ql: Encountered "c.customerID", expecting

      The only difference is that the failing query uses a java.math.BigDecimal type as input arg, while the working query uses java.lang.String as input arg type.

      Why does the 2nd query not work???

      Wouter

        • 1. Re: Wrong finder EJB-QL because of arg type?
          dsundstrom

          Ya, this sucks. The spec only acknowledges int, long, double, and float. This means that big decimal is considered a DVC. To make this worse the spec does not allow comparison between DVCes. I think this will work if you declare the query using jboss-ql in the jbosscmp-jdbc.xml file. If you don't know how to do this, take a look a the JBossOne-JBossCMP slides at our SourceForge site.