1 Reply Latest reply on Apr 23, 2008 3:02 AM by Mohammad Norouzi

    regarding EJBQL and object equality

    Mohammad Norouzi Novice

      Hi all,

      I have a simple query in which I want to select records that meet equality condition with an Enum type.

      select t from MyEntity t where t.statusType is not StatusType.NEW

      StatusType is an enum contains NEW, SENT, ABANDONED

      at first, it was an error, complained that unable to resolve the StatusType so I changed it to
      t.statusType is not com.myejb.enums.StatusType.NEW

      and it worked fine but now I need to add another condition:

      t.statusType is not com.myejb.enums.StatusType.NEW and
      t.statusType is not com.myejb.enums.StatusType.SENT

      but the TopLink complains that there is a syntax error near the [com] and she can't resolve this query.

      how can I test the equality in such way?

      thank you all