Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on entity bean question

 
Prathibha Bharathi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem

Which of the following methods must be implemented by an entity bean class with Container managed persistence?

Options

Select 1 correct option.

a.At least one ejbCreate(...)


b.ejbFindByPrimaryKey(...)


c.At least one ejbSelect(...)


d.At least one ejbFindByXXX(...) (other than ejbFindByPrimaryey(...))


f.None of these.

Answers is f.

But I think the answer is B.
Please help me!
Regards,
Prathibha
 
Surya Baabu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

The answer if (f) because for CMP beans you don't implement the ejbFinder methods in your bean class, the container does that for you.

Surya Baabu
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of the primary key is defined in a standard XML deployment descriptor file ,the container knows how to provide the ejbFindByPrimaryKey() finder method and generates the appropriate JDBC SELECT statement to support it. Therefore, You don't implement this method.
 
Prathibha Bharathi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank U Surya and Leenapongpanit! My doubt is now clarified.

Regards,
Prathibha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic