• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CMP - Table mapping

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can a CMP be mapped to more than one table in database?

Thanks
 
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic