• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP - Table mapping  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!