I'm jumping into the middle of the thread here, so I
apologize if I'm skipping something, but...

> But, my SportsCar bean HAS to extend EntityBean. How
can I have
> implementation inheritance here?

SportsCarBean does NOT have to extend entity bean
directly.  If CarBean extends EntityBean, then
SportscarBean can extend CarBean and satisfy the
requirement that your talking about...

Lauren
> > >Consider that I have two classes Car and SportsCar where SportsCar
> >extends
> > >Car. Now, the system has objects of both classes. I want to model this
> > >relationship in entity beans. How should I go about it? Can I have two
> > >entity bean classes.. CarBean and SportsCarBean?
> >You can use implementation inheritance to make SportsCarBean a subclass of
> >CarBean. You can also use interface inheritance for the remote interface.
>
> But, my SportsCar bean HAS to extend EntityBean. How can I have
> implementation inheritance here?
>
>
> >
> >The problem is with the Home interface:
> >
> >public interface CarHome extends javax.ejb.EJBHome {
> >      Car findByPrimaryKey(CarKey key)
> >   }
> >   public interface SportsCarHome extends CarHome {
> >      SportsCar findByPrimaryKey(CarKey key);
> >   }
>
> findByPrimaryKey() in SportsCar cannot return SprotsCar because then the
> return types won't match.
>
> Also, when I retrieve all the cars, I should also get SportsCars. I can't
> call two findByXXX() methods (one for Car and one for SportsCar) to retrieve
> all the cars.
>
> Please help,
> Tom.
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail 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".
>

===========================================================================
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