• 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

findByPrimaryKey() returns null

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks a lot for ur time. I have a CMP entity bean, Supplier, whose abstract schema is as below:
suppId - Integer (primary key),
suppName - String

This schema is already mapped with the underlying 'Supplier' table in the DB. Also, this table contains a few valid records. However, the findByPrimaryKey(Integer) method of this bean returns null.

Could some one please help me out with this problem. Do I need to configure any DB settings. I am using WSAD v5.1.2, CloudScape DB and CMP 2.0 specification.

I am also including the deployment descriptor for ur consideration:
<entity id="Supplier">
<ejb-name>Supplier</ejb-name>
<local-home>com.abc.xyz.entity.SupplierLocalHome</local-home>
<local>com.abc.xyz.entity.SupplierLocal</local>
<ejb-class>com.abc.xyz.entity.SupplierBean</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>Supplier</abstract-schema-name>
<cmp-field id="CMPAttribute_1128583285244">
<field-name>suppId</field-name>
</cmp-field>
<cmp-field id="CMPAttribute_1128583285254">
<field-name>suppName</field-name>
</cmp-field>
<primkey-field>suppId</primkey-field>
<query>
<description></description>
<query-method>
<method-name>findBySuppName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select object(o) from Supplier o where o.suppName = '?1'</ejb-ql>
</query>
</entity>

Bye
Thanks,
Kalyan
[ October 10, 2005: Message edited by: Kalyan Akella ]
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kalyan,
The details provided by you are insufficient, you also need to mention the details
1) how you map your DB Table to CMP fields mentioned above
2) Have you defined the datasource and mentioned datasource name in the rdbms-jar.xml?
etc..
reply
    Bookmark Topic Watch Topic
  • New Topic