0 Replies Latest reply on Jul 22, 2008 4:32 AM by Manu Osten

    Problem with MEMBER OF in EJB QL

    Manu Osten Apprentice


      I tried to use MEMBER OF in EJB QL on my local computer and it works, but it does not work on my remote server. The request List is shown different between my local computer and remote computer altough I copied all data from my local computer to remote computer.

      On my computer:
      JBoss 4.0.5
      MySQL '5.1.14-beta-standard'

      on my server:
      JBoss 4.0.5
      MySQL 5.0.45

      query = manager.createQuery("select distinct rr from Request rr "
       + " inner join rr.categoryA catA "
       + " inner join rr.categoryB catB "
       + " inner join rr.categoryC catC "
       + " where rr.reqeustStatusEnum = :status and ("
       + " rr.owner = :user"
       + " or :user MEMBER OF catA.memberList"
       + " or (:user MEMBER OF catB.memberList"
       + " and :user NOT MEMBER OF catC.memberList"
       + " and rr.timeDelay <= CURRENT_DATE"
       + " )) order by rr.requestDate");
       query.setParameter("status", s);
       query.setParameter("user", user);

      1) categoryA and categoryB is ManyToOne to UserGroup
      2) memberList in UserGroup is ManyToMany to User

      Both is using Fetch.Eager

      I don't know where is exatcly problem. MayBe at CMP?? I tried without MEMBER OF and both computer work.

      Thank you in advance