> Entity Bean: Department
>
> I look up my home object, create my department EJB, it loads and
everything
> is fine. I now want to get a list of all the employees in my department.
I
> throw in a second entity bean.
>
> Entity Bean: Employee
>
> What is the best recommended method for accessing the employees?
>
> Do I say sometyhing like: Enumeration employeeList =
> Department.getEmployees(); In this case, is it OK to have one EJB look up
> the home object on another and return the Enumeration returned by the find
> method?
In general, yes, that would be ok. Currently the Employee finder must be on
the raw primary key of the Department. The CMP engine used to support
finders on real entity references, but that was removed. I am hoping to be
able to get that back however.
> Or do I do something like:
>
> Look up the Employee home object. Execute a findByDeparmentID method?
Yes, and this is what Department.getEmployees() could/should do.
/Rickard
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]