It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes findByPrimaryKey() returns null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "findByPrimaryKey() returns null" Watch "findByPrimaryKey() returns null" New topic

findByPrimaryKey() returns null

Kalyan Akella

Joined: Oct 10, 2005
Posts: 1

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">
<cmp-field id="CMPAttribute_1128583285244">
<cmp-field id="CMPAttribute_1128583285254">
<ejb-ql>select object(o) from Supplier o where o.suppName = '?1'</ejb-ql>

[ October 10, 2005: Message edited by: Kalyan Akella ]
rajeev rana

Joined: Dec 30, 2004
Posts: 5
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?
I agree. Here's the link:
subject: findByPrimaryKey() returns null
jQuery in Action, 3rd edition