Friends,
I have a rather common pure-Java scenario which I would like to know is possible in EJBs.
I have the below class hierarchy :
InterfaceA AbstractA implements InterfaceA MyEntityBeanA extends AbstractA implements EntityBean
InterfaceB MyEntityBeanB implements EntityBean, InterfaceB
public interface InterfaceB { public String getName(); }
public abstract AbstractA implements InterfaceA { public abstract Collection getAllRelatedBeans(); // to be implemented by sub-class public void justPrintAll() { Iterator i = getAllRelatedBeans().iterator(); while(i.hasNext()) { InterfaceB interfaceB = (InterfaceB) i.next(); interfaceB.getName(); } }