How to Inheritance Enitty Bean
===========================
follow the steps

/*
* Important:
*       dont forget to add throws RemoteException for every function
*/


public interface Base
{
   public void doAppropriateThing() throws RemoteException;
}


/*
*  Important:
*       If you want to inherit Home Interface use only Finders with Enumeration
which is
*       same accross class
*/


public interface BaseHome
{
   public Enumeration FindByID() throws RemoteException, FinderException;
}


abstract public class BaseImpl implements Seriliziable
{
   public void doAppropriateThing() throws RemoteException;
}



public interface Derived_A extends Base , EJBObject
{
}


public interface Derived_A_Home extends BaseHome, EJBHome
{
        ................
        ................
}


public class Derived_A_Bean extends BaseImpl implements EntityBean
{
        ................
        ................
}




public interface Derived_B extends Base , EJBObject
{
        ................
        ................
}


public interface Derived_B_Home extends BaseHome, EJBHome
{
        ................
        ................

}


public class Derived_B_Bean extends BaseImpl implements EntityBean
{
        ..................
        ..................
}





  public class Client()
  {

      Derived_A_Home = lookup(...);
      Derived_A obj = Derived_A_Home.findByPrimaryKey(11);
      doAppropriateThing( obj);

      Derived_B_Home = lookup(...);
      Derived_B obj2 = Derived_B_Home.findByPrimaryKey(11);
      doAppropriateThing( obj2);

      public void doAppropriateThing( Base b )
      {
         b.doAppropriateThing();
      }


  }


if any question please email me at  [EMAIL PROTECTED]

- sethu


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to