• 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

EJB CMP Primary Key problem

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic