• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Query

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I create an Abstract Class say A & let it implement SessionBean. I also create the ejbCreate() & my necessary Business Methods.

All the bean classes extend the above abstract class. They Also give the implementations for the respective business methods.

Can anything of this sort can be done with EJBs. So that way, I will not have the duplicate methods for ejbActivate(),ejbPassivate() etc.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's only plain object-oriented programming, so yes I think that you can do it.
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, do we have to actually make the entry of each bean that implements the common interface in ejb-jar.xml. I mean I created an interface & I let two beans implement my interface. So I had to make entries of both the bean in ejb-jar.xml. Am I going right?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you still need to declare each been in the deployment descriptor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic