Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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

EJB Gurus, what methods a CMP entity bean must and must not implement ?

 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, EJB Gurus !
Reading EJB Specs for topic

Identify the interfaces and methods a CMP entity bean must and must not implement.

I can not realize, is it *mandatory* to provide implementations for ALL
callback methods from EntityBean interface (ejbLoad, ejbStore, ejbPassivate, ejbActivate) ? Even empty .... I suspect that we MUST provide even empty, but for what reason ? And where it written in specs ?
Since class will *alwayls* be abstract, we MAY omit some methods implemenations from interface (according for *general* Java rules).
But, CAN we do this in EJB ?
Thanks.
 
Mike Cogan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mikalai,
First thanks for the positive feedback (27/10/03) on JDiscuss regarding www.revisingscbcd.co.uk much appreciated.
To understand why you need to implement these methods you need to understand how the container works and how it provides callback methods to the entity bean (also what callback methods are). You may find it useful reading the EJB specification starting at about 10.7.7 (regarding entity bean lifecyle).
I will be posting some examples of entity beans soon on my site so it may be worth running through a few of them to get to grips with what is actually happening to the "empty" methods.
Good luck with the exam,
Mike Cogan
[ November 14, 2003: Message edited by: Mike Cogan ]
[ November 14, 2003: Message edited by: Mike Cogan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic