• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP Mappings

 
jyothi godavarthy
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an interview I was asked, how will you map the fields in the bean to the database fields in a CMP bean, so I answered you specify the entity variable names and corresponding database column name in the deployment descriptor, so the interviewer asked what r the types of mappings, have you heard top bottom, bottom top and middle top mappings, can anyone tell me what these are, any link where i can read in detail about this will be helpful.
Thanks in advance.
 
Roland Barcia
author
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Top-down means generating a database script based on an existing set of Entity Beans:
Meet-in-the-Middle means mapping an existing set of entity beans to an existing set of tables
Bottom-up means generating a set of entity beans from existin database tables.

Understand that the EJB specification does not define how a vendor chooses to map entity beans to its underlying DB representation. This is left up tot he container. So how Entity Beans are mapped are different from container to container. The ejb-jar.xml willnever contain mapping information. So the correct answer to the first question would me it depends on the verndor. Most vendors use propiertary deployment descriptors that are packaged along with the EJB module. WLS use weblogic-ejb-rdbms-jar.xml (something like that) while WebSphere uses mapxmi.xmi file.
As far as the three approaches, the answer above seems specific to WebSphere.
 
jyothi godavarthy
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roland Barcia, that was very helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!