wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "composite entity pattern" Watch "composite entity pattern" New topic
Author

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
-------1----*-----*-----1-----1---*----------*---1

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.
OR
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 :-
http://java.sun.com/blueprints/patterns/CompositeEntity.html

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 ???
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: composite entity pattern
 
Similar Threads
Composite Entity Pattern
Composite Entity and EJB 2.0
help regarding EJB-QL
Is the J2EE Composite Entity pattern dead?
desing question about composite entity pattern