> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Krzysztof Zieliński

> There are three tables in database schema:
>
> +---------+-----------+----------+---------+---
> User: | userId | username | password | .... | ..
> +---------+-----------+----------+---------+---
> +---------+-----------+----------+---------+---
> Group: | groupId | groupname | .... | .... | ..
> +---------+-----------+----------+---------+---
> +----------+----------+
> Groups: | groupId | userId |
> +----------+----------+
>
> "User" and "group" tables hold data for users and groups respectively and
> "groups" table keeps track of the relation between these tables. "groups"
> table is indexed by both fields so it is fast to find answer to questions:
> "For which groups user X belongs to?" and "Who belongs to group X?".
>
> How to design EJB entitys ?

It looks to me like you could do away with the Groups table (which is nothing more
than a joint table) and use a Many-Many relationship between User and Group.

Specifying this architecture is trivial with EJBGen :-)
(http://beust.com/cedric/ejbgen)

--
Cedric

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