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

methods to be implemented by Entity Bean with CMP

 
Rajesh Chande
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following methods must be implemented by an entity bean class with Container managed persistence?

Select 1 correct option.
A. At least one ejbCreate(...)
B. ejbFindByPrimaryKey(...)
C. At least one ejbSelect(...)
D. At least one ejbFindByXXX(...) (other than ejbFindByPrimaryey(...))
E. None of these.

I selected the option B. The spec also says the same thing on page 271. = "Every entity bean must define the ejbFindByPrimaryKey method."

The test exam says the correct option is E.

Any takers?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B is wrong. The findByPrimaryKey method is implemented by the application server, not the bean programmer.
You do need to define it in the home interface(s) though to return the correct type and take the correct type parameter.

ejbCreate is required only for sessionbeans.

the others are never required.

So e) is indeed the only correct answer.
 
Rajesh Chande
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I can say that option B would have been correct in case of a Entity Bean with BMP.

right?
 
Arun Natarajan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes option B would have been correct if it were an entity bean with BMP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic