• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP fields' names?  RSS feed

 
Pourang Emami
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer to the following question will be highly appreciated:
**Can the name of CMP fields be different from the actual name of the fields in DBMS?
**Is this just the matter of changing the names in the components, or there are some other actions should be taken?(because I haven't seen any thing in ejb-jar.xml relating these two names to eachother)
Thank you
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37253
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pourang,
Yes the CMP fields can have different names from the database fields. In Websphere, this is defined in the mapping (tablexml) files. I'm not sure if this is app server specific though.
 
Sergiu Truta
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For JBoss the deployment descriptor containing the information for mapping entity fields to database fields can be found inside jbosscmp-jdbc.xml.
Here is some sample:
<jbosscmp-jdbc>
<enterprise-beans>
<entity>
<ejb-name>TApplicativoAttributiIci</ejb-name>
<table-name>T_AIII_APPL_ATTRIBUTI_ICI</table-name>
<cmp-field>
<field-name>codice</field-name>
<column-name>CODICE</column-name>
</cmp-field>
<cmp-field>
<field-name>descrizione</field-name>
<column-name>DESCRIZIONE</column-name>
</cmp-field>
<cmp-field>
<field-name>flagAbitazionePrincipale</field-name>
<column-name>FLAG_ABITAZIONE_PRINCIPALE</column-name>
</cmp-field>
<cmp-field>
<field-name>cCTimeStamp</field-name>
<column-name>CCTIMESTAMP</column-name>
</cmp-field>

You should look into the deployment descriptors specific to your application server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!