2 Replies Latest reply on Jul 17, 2004 7:05 PM by John Shepherd

    EJB query language:- problem using 'LIKE'

    John Shepherd Newbie

      Hi,


      I am writing my first entity bean using CMP.
      I have a problem using the 'LIKE' operator in an EJB query.
      I've not had any problems using the "=" operator.


      The error I get on deployment is:

      >Error compiling EJB-QL statement 'SELECT OBJECT(c) >FROM Contract c
      > WHERE c.lastName LIKE ?1'; - nested throwable: >(org.jboss.ejb.plugins.cmp.ejbql.ParseException: >Encountered "1" at line 2, column 35.
      >Was expecting:
      > <STRING_LITERAL> ...


      The section from my ejb-jar is:


      <query-method>
      <method-name>findByLastName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      SELECT OBJECT(c) FROM Contract c
      WHERE c.lastName LIKE ?1
      </ejb-ql>


      Any help is much appreciated.

      Cheers
      John


      )]