Damon,
 
It's like this:
 
When you write your ejbFindXXX() methods, you return primary keys or collections thereof (and when
the spec says "collection" it means "something that implements java.util.Enumeration", at least until
a revised spec is released that uses JDK 1.2, er, Java2 collections).
 
The container takes this collection of primary keys, automagically transforms it into a
collection of remote references, and returns the collection of remote references to the
client.
 
Thus, the return type of ejbFindXXX() is always a primary key or a collection thereof, and the return
type of findXXX() in the home interface is always a remote interface or collection thereof. (You
don't implement findXXX() -- you write the interface and feed it to the container; the container
then generates a bunch of wrapper classes that eventually call your ejbFindXXX() method).
 
Make sense?
 
 
===========================================================================
  Tom Valesky   -- [EMAIL PROTECTED]
       http://www.patriot.net/users/tvalesky
-----Original Message-----
From: Damon Williams <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, March 03, 1999 3:58 PM
Subject: ejbFind() method return types

On page 71 of the Spec (1.0), in section 9.7.5:
 
"The return type of a finder method must be the enterprise Bean's primary key type, or a collection of objects of the primary key type."
 
On page 72 in section 9.7.8:
 
"The return type for a finder method must be the enterprise Bean's remote interface type, or a collection thereof."
 
I don't understand the discrepancy!  Is this a typo?  Also, let's say we define an ejbFindLargeAccounts(double amount) method, in the body of which we execute the SQL query and receive a ResultSet back with a selection of rows from the database.  How then do we turn this data into a collection of Entity Bean remote interfaces, which is what section 9.7.8 requires us to return?
 
 
---------------------------------------------------
Damon Williams
Simplified Telesys
Sun Certified Java Programmer
www.simpletel.com
 

 

Reply via email to