You are on the right track.
The awards enumeration does not belong in the person bean. The getAwards()
interfac eshould do a dynamic lookup and return the enumeration.

If you also need to have to enumerate the persons for a given award, define
an AwardBean to encapsulate a row of the award table and provide a
getPersons() interface to do dynamic database lookup to return the person
enumeration.

Hope this helps.

vela


----- Original Message -----
From: Shawn McKisson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 14, 1999 12:40 PM
Subject: I'm not understanding EBs.


> I am trying to build my first non-simple entity bean, however, I'm having
some
> problems.
>
> What I have are people and awards.
> People is a simple table with only a "name" field and primary key.
> Awards is a simple table with only a "name" field and primary key.
>
> Since the relationship between people and awards is M x N, I have a
relationship
> table which describes what people have which awards.
>
> My goal is to have an EB through which I can manipulate and view the
people and
> their awards.
>
> My initial thought is to simply put a
>
> private Enumeration awards;
>
> as a instance variable of the PeopleBean. But I keep reading everywhere
that an
> entity bean should represent 1 row of data from the data base. Placing
this
> enumeration in the PeopleBean would mean that it represents n rows (1 for
each
> award the person has won)
>
> The remote interface I would like to have for people is
>
> String getName();
> Enumeration getAwards();
>
> The fact that I want an enumeration of awards back makes me think that I
should
> also have an Award EB that has a finder method suck as
findAwardsByPerson();
>
> How should I handle this situation? Is creating an AwardBean the "proper"
thing
> to do?
>
> --shawn
>
>
===========================================================================
> 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