This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a single Entity bean for two tables+BMP

 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can anyone help me in writing a single Entity Bean using BMP for two tables.
Generally we will write seperate entity bean for seperate table.But if tables are large then maintenance of Entity beans will become clumsy and very hard to write.Can anyone suggest some other way for implementing this in EJB 2.0.
Thanks in advance
With kind Regards
Satheesh.K
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me in writing a single Entity Bean using BMP for two tables.

You can use CMR (Container Managed Relationship) to link tables together via Entity Bean, however, as you expected, this will lead to poor performance if the table size is too large.


But if tables are large then maintenance of Entity beans will become clumsy and very hard to write.Can anyone suggest some other way for implementing this in EJB 2.0.

In such case, I will seperate the data access into 2 parts. For tables with less data, I will use Entity Bean. But for tables with huge data, I will use plain JDBC via a DAO service.

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic