• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbFind methods

 
Peter Warde
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was doing a mock exam from SoftLearn and came across a solution to a question that said that ejbFind methods must return a single primary key or its collection.

This has got me confused because I though that finder methods are defined on the home interface and a query in the DD and never in the bean class itself. So how can this be a solution to the problem?

Can anyone clear this up?

Thanks

Peter
 
Paul Maessen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you say is true for CMP, but for BMP you implement for each finder method in the home interface, a corresponding ejbFind method in the bean that returns (a collection of) the primary key.
 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't finders return component interfaces (or collections of) that correspond to the primary key, and not the primary key itself.

James.
 
Paulus Maessen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finder method defined on the home interface returns (collections of) component interfaces.

The corresponding ejbFind... method on the *bean* return (a collection of) primary keys though.
 
Paulus Maessen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finder method defined on the home interface returns (collections of) component interfaces.

The corresponding ejbFind... method on the *bean* return (a collection of) primary keys though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic