0 Replies Latest reply on Feb 11, 2003 4:40 AM by Dries De Moor

    How to define finder methods that need to search over more t

    Dries De Moor Newbie

      Hello,

      Say you have this situation: 3 CMP beans: Machine, Product and Material.
      A Product is made on a machine and on one machine many products can be produced.
      Each product is made of 1 material but 1 material can be used for many products.

      What I want to do is select all the product that are produced on a machine and with a particular material.
      I could do it with a finderMethod in the MAchineBean to retreive all the products for the machine. And than iterated over all those products and check the material using the CMR method getMaterial.
      Instead of using the getMaterial CMR method I could define a findByMaterial method in the product bean which gives me all the products made with the given material.
      And then iterate over the 2 Collections to find out which product occur in both Collections.

      But I wonder if there is a way to define only one finder or ejbSelect method that gives me the result directly?

      Can somebody give me some advice on this.

      Kind regards,

      Dries