0 Replies Latest reply on Aug 17, 2005 6:50 AM by Sven Baumgarten

    EJB QL and collection parameter

    Sven Baumgarten Newbie

      Hi

      I want to find some entities by their keys key1,key2,key3. I can do this by:

      findByPrimaryKey(key1)
      findByPrimaryKey(key2)
      findByPrimaryKey(key3)

      in this way 3 sql select are processed (SELECT ... WHERE id=?1)

      Is somthing like this possible:

      Collection c = new Collection()
      c.add(key1)
      c.add(key2)
      c.add(key3)
      findByKeys(c)

      so that there is only one sql select processed (SELECT ... WHERE id=?1 OR id=?2 OR id=?3)

      Is there a EJB QL notation that can do this?

      regards,
      Sven