File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes composite entity pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "composite entity pattern" Watch "composite entity pattern" New topic

composite entity pattern

Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
Hi all,
How can I implement the composite entity pattern in EJB 2.0, OR has it become obsolete in EJB 2.0 because of the local interfaces??

Say for eg I have 5 tables...

category--- prodcat-----product---storeProduct---Store

Category, Product and Store are the main tables.
prodcat and storeproduct are the link tables between these 3.
(the relationships are shown below the table names, like category to prodcat is 1 to many .....)

What's the best way to design this in EJB using CMP ?. Should I create 5 entity beans (one for each table) with local interfaces and relationships between them as shown.
Should I create Category, Product and Store as Entity beans and prodcat and storeProduct as dependent object ???
[ February 21, 2005: Message edited by: Giju George ]

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
Got some hints from this site :-

to create each one as seperate entity beans.

But then, will there be too many entity beans lying in the container, (consider this as a big application) ???
Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
guys...any comments ???
I agree. Here's the link:
subject: composite entity pattern
jQuery in Action, 3rd edition