Jim,

<vendor>

IAS 4 provides the ability to use primary keys as parameters
to finder method.

Alternatively, you could have the finder method take the
Address remote references as a parameter:

        public Collection findByAddress(Address a) ...;

which seems a little more object-oriented, to me, instead
of dealing always with primary keys.

See our example:

        <ias>/examples/ejb/pigs

for details.

</vendor>

-jkw

Jim Archer wrote:
>
> Hi All...
>
> I'm wondering if it is possible to have a finder method that accepts as a
> parameter the primary key object of another EB.
>
> For example, I might have a PersonEB entity bean that has a reference to an
> AddressEB entity bean. The AddressEB would have its own primary key class,
> AddressPK. The Person bean might have a finder method like this:
>
> public Collection findByAddress(AddressPK adr) throws FinderException,
> RemoteException;
>
> Of course, the idea is to use CMP to persist all the Person beans and all
> the Address beans and to not replicate addresses in the database
> unnecesserally. Five people with the same address would each have a
> reference to the same Address bean. This is a contrived example. My actual
> project will win big doing this type of thing.
>
> It seems easy enough to code the method, of course, but how does it get
> deployed? Is this doable?
>
> Thanks!
>
> Jim
>
> ===========================================================================
> 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".

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