1 Reply Latest reply on Nov 14, 2001 6:11 PM by Allen Fogleson

    How to define local finder in ejb-jar.xml (CMP2)

    Martin Kuhn Newbie

      Hi all!

      What is the right way to define a local finder in the ejb-jar.xml????

      JBoss (3.0) means always "Query method not found: findAll"

      I declared
      public java.util.Collection findAll()
      throws javax.ejb.FinderException;

      im my LocalHome-Interface

      TIA Martin


      My definitions:

      ejb-jar.xml:




      <ejb-name>Genre</ejb-name>

      <local-home>at.mfa.ejb.entity.GenreLocalHome</local-home>
      at.mfa.ejb.entity.GenreLocal

      <ejb-class>at.mfa.ejb.entity.GenreCMP</ejb-class>

      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      True

      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Genre</abstract-schema-name>
      <cmp-field>
      Description of genre
      <field-name>description</field-name>
      </cmp-field>
      <cmp-field>
      Id of this genre.
      <field-name>id</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>

      <result-type-mapping>Local</result-type-mapping>

      <ejb-ql>WHERE id IS NOT NULL</ejb-ql>




      <method-permission>


      <ejb-name>Genre</ejb-name>
      <method-intf>LocalHome</method-intf>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>

      </method-permission>


        • 1. Re: How to define local finder in ejb-jar.xml (CMP2)
          Allen Fogleson Newbie

          > Hi all!
          >
          > What is the right way to define a local finder in the
          > ejb-jar.xml????
          >
          > <abstract-schema-name>Genre</abstract-schema-name>
          >
          > <query-method>
          > <method-name>findAll</method-name>
          > <method-params>
          > </method-params>
          > </query-method>
          > <result-type-mapping>Local</result-type-mapping>
          > <ejb-ql>WHERE id IS NOT NULL</ejb-ql>
          >

          It should be something like this...

          <abstract-schema-name>genre</abstract-schema-name>
          ...
          <ejb-ql>SELECT OBJECT(g) FROM genre AS g where g.id IS NOT NULL</ejb-ql>

          Al