3 Replies Latest reply on Jul 3, 2005 2:23 AM by Yu He

    EJB-QL WHERE ... LIKE construct problem

    Tony Dodd Newbie

      Using JBoss 3.2.3, I'm trying to implement a finder method on an entity using a wildcard and the WHERE ... LIKE construct.

      My EJB-QL is as follows.

      SELECT OBJECT(o) FROM BicBankEntity AS o
      WHERE o.cInstCouLoc like ?1

      This fails with the following error when installing the EJB.

      [ObjectName: jboss.j2ee:jndiName=IntraInstitutionVolumeEntityRemote,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL
      statement 'SELECT OBJECT(o) FROM BicBankEntity AS o WHERE o.cInstCouLoc like ?1
      '; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encounte
      red "1" at line 1, column 67.
      Was expecting:
      <STRING_LITERAL> ...
      )]

      I have tried using the following EJB-QL

      SELECT OBJECT(o) FROM BicBankEntity AS o
      WHERE o.cInstCouLoc like '?1%'

      but the SQL generated merely tries to match the column with the literal '?1%'.

      How should the WHERE ... LIKE clause be specified?, is this a bug in 3.2.3.

      Any help would be appreciated.

      Thanks in advance