• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB

 
Pappu Kumar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does an entity bean have to represent a single table. Is it recommended to have one entity bean represent data in 4-5 different tables. so that any changes to this entity bean make updates to those 4-5 tables. If not whats a suggested method for such issues.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An Entity Bean can represent anything you want it to. Most of what I've read recommends having one Entity Bean to a table when you are accessing it through a local interface. If it is being accessed remotely, you may want to have it represent more than one table to limit the number of method calls the client needs to make. If you search this forum on fine grained vs. course grained beans you should find more information.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A CMP entity bean is worse than you feared - it represents one ROW of one table. If you think this sounds like an uncomfortable force-fit, you're not alone.
A BMP bean can be backed by anything - database tables with views, joins, and sprocs, flat files, asynchronous messages to a legacy mainframe, you name it - so long as it implements the interfaces to do load and store.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!