1 Reply Latest reply on Jan 22, 2005 11:03 AM by Hari Velappan

    EJB QL/JBoss QL possible across a collection?

    David Cracauer Newbie

      Hello,
      I'm currently trying to convert from Weblogic 6.1 to JBoss, and I've run into a problem.

      I have a finder that won't deploy, and I've come to find out that it is illegal for a path expression to navigate a collection.

      For example, we really need to do somethibg like this, but it is illegal:

      @ejb:finder
      signature=
      "java.util.Collection findGrandChildrenByGender(java.lang.Integer genderId)"
      query=
      "Select object(a) from Grandparents where a.children.grandchildren.gender.id=?1"

      Is there a way to make this work?


        • 1. Re: EJB QL/JBoss QL possible across a collection?
          Hari Velappan Newbie

          query="SELECT OBJECT(h) FROM Parent AS h , Child AS d WHERE d.commodityCode=?1 AND d MEMBER OF h.details"


          This query check for a commodity code in the child and checks whether the matching child belongs to a parent.


          In your case

          query="SELECT OBJECT(h) FROM GrandParent AS GP , Children AS CH, GrandChildren AS GC, Gender GT WHERE GT.id=1 AND GT MEMBER OF GC AND GC MEMBER OF CH AND CH MEMBER OF GP


          Please try this