1 Reply Latest reply on May 29, 2003 7:51 AM by Manos Dramitinos

    Custom finders help neeeded

    Manos Dramitinos Newbie

      Hi,

      I am trying to implement a custom finder. I have an entity EJB with CMP.

      I have coded a custom finder method findCheapAuctions in the bean home interface:

      public Collection findCheapAuctions(int startP)
      throws FinderException, remoteException;

      and then I have coded the following on jaws.xml :


      Hypersonic SQL
      <type-mapping>Hypersonic SQL</type-mapping>

      <enterprise-beans>

      <ejb-name>Auction8EJB</ejb-name>
      <table-name>AUCTION8</table-name>
      <cmp-field><field-name>auctionId</field-name><column-name>AID</column-name></cmp-field>
      <cmp-field><field-name>organizerId</field-name><column-name>OID</column-name></cmp-field>
      <cmp-field><field-name>resourceId</field-name><column-name>RID</column-name></cmp-field>
      <cmp-field><field-name>description</field-name><column-name>DESCR</column-name></cmp-field>
      <cmp-field><field-name>startDate</field-name><column-name>STARTD</column-name></cmp-field>
      <cmp-field><field-name>endDate</field-name><column-name>ENDD</column-name></cmp-field>
      <cmp-field><field-name>comments</field-name><column-name>COMMENTS</column-name></cmp-field>
      <cmp-field><field-name>startPrice</field-name><column-name>STARTP</column-name></cmp-field>
      <cmp-field><field-name>auctionType</field-name><column-name>AUCTYPE</column-name></cmp-field>
      <cmp-field><field-name>auctionHistory</field-name><column-name>AUCHISTORY</column-name></cmp-field>
      <cmp-field><field-name>bidIncrement</field-name><column-name>BIDINC</column-name></cmp-field>
      <cmp-field><field-name>auctionWinnerId</field-name><column-name>AUCWINNERID</column-name></cmp-field>
      <cmp-field><field-name>auctionPrice</field-name><column-name>AUCPRICE</column-name></cmp-field>

      findCheapAuctions
      startPrice &lt; {0}
      startPrice DESC


      </enterprise-beans>


      However, I keep getting the following error:

      Bean : Auction8EJB
      Method : public abstract Collection findCheapAuctions(int) throws FinderException, RemoteException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in
      the deployment descriptor.

      Any ideas what I might have done wrong? I guess I must have a mistake on my jaws.xml file? I have tried to solve this for a long time but failed, so any help is appreciated.

      Thanks in advance for your help!

      Manos