cancel
Showing results for 
Search instead for 
Did you mean: 

Enitty ejb findByPrimaryKey with a compund key

derekvincent
Participant
0 Kudos

All,

I have a CMP entity bean with a compounded primary key and the the default finder findByPrimaryKey by default has the return type set the compound primary key class. I am not sure If this is correct or not. I would have expect it to return a the entity object as opposed to the pimary key class.

It is possible I do not understand this purpose of this finder method...

Any help or clarification would be greatly appreciated.

Cheers,

Derek

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Derek,

Yes, the findByPrimaryKey method on the home interface must return the entity object. For BMP beans there has to be a corresponding ejbFindByPrimaryKey method on the bean class which returns the primary key type. However, for CMP beans the bean provider does not write such ejbFind methods but specifies EJB QL queries.

Cheers,

\-- Vladimir

Answers (1)

Answers (1)

derekvincent
Participant
0 Kudos

I think what I found was a bug in the NWDS. When I created a CMP bean with a complex PK the screen that shows the finder methods shows the return type of the primary key but in the classes the return type is set correctly to the entity object.

I am using 6.40 SP18 NWDS.

Cheers,

Derek