• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP - Table mapping

 
s khosa
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a CMP be mapped to more than one table in database?

Thanks
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In CMP, you create an entity bean, say Customer entity bean. This maps to the Customer table and each instance of the entity bean maps to a record in the table. If you want to map the same entity bean to more than 1 table, you would have to use Container Managed Relationships which are not available in EJB 1.1. In CMR, you can maintain a relationship between the Customer and related Orders in the Customer entity bean itself you can have a business method in Customer entity bean to return the details of the related Orders. You cannot do it in EJB 1.1 which is covered by SCEA
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!