What do EJB multi-object finder methods return?
What do EJB multi-object finder methods return? |
The contents of the Enumeration or Collection must be extracted and then narrowed by using the following method:
Address address = new Address(null, null, null, "MA", 0); java.util.Iterator instructors = instructorHome.findByAddress(address).iterator(); while(instructors.hasNext()) { Instructor instructor = (Instructor) javax.rmi.PortableRemoteObject.narrow(instructors.next(), Instructor.class); System.out.println("findByAddress(state=MA) : " + instructor.getName()); } This is very much in compliance with the EJB specification. It is other products which violate the specification by not supporting the PRO.narrow functionality.
|
Article originally contributed by Borland Developer Support