• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

how to decide how many entity beans to have

 
Ranch Hand
Posts: 312
  • 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
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess would be 40 entity beans, one for each table.
 
Ranch Hand
Posts: 775
  • 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.
 
Ranch Hand
Posts: 1066
  • 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...
reply
    Bookmark Topic Watch Topic
  • New Topic