• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB CMP Primary Key problem

 
Mohnish Saini
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends

I have an EJB application in which primaryKey(PK) is generated through this:

<weblogic-rdbms-bean>
<ejb-name>CoverageList</ejb-name>
<data-source-name>LINKS_ADMIN</data-source-name>
<table-map>
<table-name>COVERAGELISTS</table-name>
<field-map>
<cmp-field>constants</cmp-field>
<dbms-column>CONSTANTS</dbms-column>
</field-map>
<field-map>
<cmp-field>coverageId</cmp-field>
<dbms-column>COVID</dbms-column>
</field-map>
<field-map>
<cmp-field>groupId</cmp-field>
<dbms-column>GROUPID</dbms-column>
</field-map>
<field-map>
<cmp-field>keyValue</cmp-field>
<dbms-column>KEYVAL</dbms-column>
</field-map>
<field-map>
<cmp-field>rangeMin</cmp-field>
<dbms-column>RANGEMIN</dbms-column>
</field-map>
<field-map>
<cmp-field>rangeMax</cmp-field>
<dbms-column>RANGEMAX</dbms-column>
</field-map>
<field-map>
<cmp-field>displayMin</cmp-field>
<dbms-column>DISPLAYMIN</dbms-column>
</field-map>
<field-map>
<cmp-field>displayMax</cmp-field>
<dbms-column>DISPLAYMAX</dbms-column>
</field-map>
<field-map>
<cmp-field>primaryKey</cmp-field>
<dbms-column>PK</dbms-column>
</field-map>

</table-map>
<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>COVERAGELISTS_SEQ</generator-name>
<key-cache-size>10</key-cache-size>
</automatic-key-generation>

</weblogic-rdbms-bean>

And this primary key we are mapping(in red below):

<entity>
<display-name>CoverageList</display-name>
<ejb-name>CoverageList</ejb-name>
<local-home>com.ovid.links.admin.ejb.CoverageListHome</local-home>
<local>com.ovid.links.admin.ejb.CoverageList</local>
<ejb-class>com.ovid.links.admin.ejb.CoverageListEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>CoverageList</abstract-schema-name>
<cmp-field>
<field-name>constants</field-name>
</cmp-field>
<cmp-field>
<field-name>coverageId</field-name>
</cmp-field>
<cmp-field>
<field-name>groupId</field-name>
</cmp-field>
<cmp-field>
<field-name>keyValue</field-name>
</cmp-field>
<cmp-field>
<field-name>rangeMin</field-name>
</cmp-field>
<cmp-field>
<field-name>rangeMax</field-name>
</cmp-field>
<cmp-field>
<field-name>displayMin</field-name>
</cmp-field>
<cmp-field>
<field-name>displayMax</field-name>
</cmp-field>
<cmp-field>
<field-name>primaryKey</field-name>
</cmp-field>
<primkey-field>primaryKey</primkey-field> <query>

I need to change this Integer datatype to String so that whatever values comes from db, it should save as string.

Thanks
Mohnish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!