File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to decide how many entity beans to have

 
manish ahuja
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
Say i have a database with 40 tables where in each of them i would be having some manipulation(insert/update/delete) as well querying from the same.
In such a scenario how to decide for how many tables do we need to create entity beans
Rgrds
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess would be 40 entity beans, one for each table.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, for CMP the correspondence is going to be close. Ignoring other ways of getting data (views, stored procedures), what you'll have is:
T = number of tables we want to provide data to/from the application
R = number of relationship tables
O = number of other tables maintained outside the application
(e.g. via triggers)
T + R + O = the total number of tables
So "T" would be the number of CMP-based entity beans you'll have. The "R" tables are used for maintaining the constraints, and they'll be mentioned in whatever container-specific deployment descriptor or tool you use for specifying your CMR implementation. The "O" tables are just stuff you are required to have but the application may not care about, like automatically maintained audit trails.
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though the specs do not require this, some application servers allow entity beans to span across multiple tables. Based on your business functionality, you could have less number of entity beans. But the drawback of this approach, is that it could make your code non-portable across other app servers that do not support this feature...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic