2 Replies Latest reply on Oct 4, 2003 12:07 PM by Alex Paransky

    Can finders use Collection as parameters?

    Alex Paransky Newbie

      Is there a way to make the following work?


      <query-method>
      <method-name>findByComponents</method-name>
      <method-params>
      <method-param>java.util.Collection</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      select object(pv) from pictureValue pv where pv.component member of ?1
      </ejb-ql>


      Thanks.

        • 1. Re: Can finders use Collection as parameters?
          eric g Newbie

          Hello,

          could you more specific with what your finder is trying to achieve ? If you are using simple select query why not use ejbSelect as it prove much more simple and flexible


          Thanks.

          • 2. Re: Can finders use Collection as parameters?
            Alex Paransky Newbie

            I have a relationship between Component (1) <- (1) PictureValue. PictureValue could navigate to the Component. I have a collection of Component EJBs, and I am trying to find all the PictureValue EJBs by seeing if the PictureValue.component MEMBER OF CollectionOfComponents.

            In other words, I was trying to pass a collection of objects to the finder.

            I looked at the EJB spec, and EJB-QL does not support this construct. So even if JBOSS does, my code will not be J2EE compliant.

            I have since decided to follow a different approach.

            Thanks.
            -AP_