0 Replies Latest reply on Nov 2, 2005 6:32 AM by marius.oancea

    EJBQL and ManyToMany

    marius.oancea

      I have 3 entities :
      User, Group, Item

      One user can be part of many groups and one group has many users in it.

      One Group has many Items available and One Item can be part of many Groups.

      Ok. I mapped the above and all seems nice.

      I do something like that :

      em.createQuery("select l from Item l where l.title like :search ")


      to get all Items having a string in "title". How do I limit the query only to the Items allowed for the groups of user X ?

      In short I need an example of a ejbql statement where ManyToMany is considered.
      Thanx