Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How are variables initialized in BMP when findByPrimaryKey is called  RSS feed

 
sanpra sing
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I know the answer but I want to verify it.
In BMP how are the instance variables of the entity bean initialized when the findByPrimaryKey method is called?
thanks.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container will call ejbLoad when you need to initialize the bean state.
All you have to do in findByPrimaryKey is return the PK if it is there, throw ObjectNotFoundException if not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!