XMLs for Deploying the entity bean with compound key.


EJB programming & troubleshooting: XMLs for Deploying the entity bean with compound key.

  1. Hi ,
    I am working with an entity bean(CMP) . Here i need to use a compound key in my custom key class. Due to some circumstances I am deploying the bean manually by generating the three XML files needed for the deployment i.e.
    The problem i am facing is in the weblogic-cmp-rdbms-jar.xml . I am not able to figure out a way to describe a finder method in this file.

    The method has been declared as follows in the CampaignHome

    public Campaign findByPrimaryKey(campaignPK key) throws FinderException,RemoteException;

    The key is made up of ( String Year, int emp_id ).

    I am writing it like....
           <method-param>what to write HERE </method-param>
         <finder-query>What to write here</finder-query>

    This is giving me errors while deployment.
    Can anybody help me to sort this problem. Am I missing something here.

    Thanking in advance,
  2. Vinod,
    Very quickly
    How to define a finder in WL:

    <![CDATA[ (> amount $0)]]>

    Remember that you have to define that finder method with the same args and types in your ejb Home like the following:

    public Enumeration findAmountsGreaterThan(doubleamountGreaterThan)
    throws FinderException, RemoteException;