This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes findByPrimaryKey Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "findByPrimaryKey" Watch "findByPrimaryKey" New topic
Author

findByPrimaryKey

Kevin DesLauriers
Ranch Hand

Joined: Nov 28, 2005
Posts: 43
Okay, for EJB 2.0 HF (pg 279) says that the you must return the remote component interface for findByPrimaryKey() in the Remote home interface.

Whizlabs, and the spec says that any finder methods must return the entity bean's primary key or a collection of primary keys. I know that that for CMP beans you don't implement the finders in your bean class but I still want to confirm that they have different return types in the home and the bean class for finder methods.

Thanks.
[ October 28, 2007: Message edited by: Kevin DesLauriers ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

That's right. In the (remote/local) home interface, the return type will be the bean's (remote/local) interface, or a collection of it. But in the bean, the return type of a finder method must be the entity bean's primary key type, or a collection of primary keys.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: findByPrimaryKey
 
Similar Threads
ejb question
Running SQL in an EJB
EJBQL vs SQL
choosing between home business methods and finders
Error: [ ejbFindByPrimaryKey ]