After reading the EJB spec and playing around with EJBs for a few months,
I'm running into an issue and am wondering if anyone else has found a
solution:

I'm having difficulty determining how to get a FindByXXX method return a
collection of Remote Interface references to multiple EJB types.   The whole
goal is polymorphism-- how can I get a collection of remote interface
references, and when I call methods on the remote interface references, the
code which executes depends on the actual reference type.

One approach:

If my home interface is this:

public interface FooHome extends EJBHome {
  public Foo create( ... ) throws ...
  public Foo findByPrimaryKey( FooPK ) throws ...
  public Enumeration findCollection( ... ) throws ...
}

And I have remote interfaces like this:

public interface Foo extends EJBObject {
  public int doSomething( ) throws ...
}

public interface Bar1 extends Foo, EJBObject {
  public int doSomething( ) throws ...
}

public interface Bar2 extends Foo, EJBObject {
  public int doSomething( ) throws ...
}

How can I get the findCollection method to return an Enumeration of
references to possibly multiple EJB Remote Interfaces (including Bar1, Bar2,
etc.) all of which implement the Foo interface?

Thanks!
-Steve Roth, [EMAIL PROTECTED]

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