Can the bean class which implements either javax.ejb.EntityBean or javax.ejb.SessionBean be inherited from any other class?

Robert Castaneda

Yes it can, refer to the following sections of the EJB 1.1 specification:

Session Beans (Section 6.10.2)

The session bean class may have superclasses and/or superinterfaces. If the session bean has superclasses, then the business methods, the ejbCreate methods, the methods of the SessionBean interface, and the methods of the optional SessionSynchronization interface may be defined in the session bean class, or in any of its superclasses.

Entity Beans (Section 9.2.2)

The entity bean class may have superclasses and/or superinterfaces. If the entity bean has superclasses, the business methods, the ejbCreate and ejbPostCreate methods, the finder methods, and the methods of the EntityBean interface may be implemented in the enterprise bean class or in any of its superclasses.

Keep in mind that the superclass must adhere to the rules and restrictions set out in section 18.1.2 of the specification.

Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact