0 Replies Latest reply on Oct 4, 2004 6:31 AM by atonyd

    EJB-QL

    atonyd

      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