What's wrong with just one table?

(id, description, parent)

If you're using EJB2.0, you can even define the parent as a CMR field.
My application has an elaborate ragged hierarchy built up on CMR fields
like this (using Orion's EJB2.0 support, btw).

If you really need to be able to quickly do multiple parent traversal,
you could always add the grandparents, leaving them null when not
applicable:

(id, description, parent, grandparent, greatgrandparent)

Jeff

>-----Original Message-----
>From: que [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 04, 2001 12:31 AM
>To: [EMAIL PROTECTED]
>Subject: tree like entities
>
>
>Hi, all,
>I would like to use entity beans to implement a tree like entity.
>
>i.e., 3 tables in a RDBMS,
>A(a, description)
>B(a, b, description)
>C(a, b, c, description)
>
>A--*>B--*>C
>
>a is the PK of table A;
>(a, b) is the PK of table B; a is a foreign key to A.
>(a, b, c) is the PK of table C; (a, b) is a foreign key to B.
>
>Both A, B, C may be edited by the client.
>
>I knew that it is not a good idea to map each table as an entity
>bean. Then what should I do?
>
>Thanks.
>Que
>
>===============================================================
>============
>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