• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generalizations and EJBs - Part II

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This question is related to Part II of the exam but the question as such pertains to general EJB concepts.

Suppose I have a relationship such as Customer "is a" User where Customer is an Entity Bean and User is not a business entity but a regular abstract base class.
Can I have the Customer EJB extending the User abstract class? If so, How is it implemented?
Does inheritance work the same way in EJBs as in regular Java classes?
Thanks in advance
Sridhar
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sridhar Raman001:
... Can I have the ... EJB extending the ... abstract class? If so, How is it implemented? ...


Hi Sridhar,
the following worked in a project:
public class MyEntityBean
extends EntityBeanAbstr // what you want to add
implements EntityBean // what the EJB container needs
public abstract class EntityBeanAbstr
extends DbConnectionFactoryBeanAbstr // as an example ...
public abstract class DbConnectionFactoryBeanAbstr // not via deployment descriptor here
// no extends or implements ...

But this is true for the BEAN CLASS only and not for the home or remote interfaces.
The home or remote interface must extend EJBHome and EJBObject directly.
Otherwise (not the compiler but) the verifier of the deploymenttool and the one of the ATG J2EE server insisted that the remote interface MySession must _directly_ extend EJBObject. There is not any interface level possible between the interfaces MySession and EJBObject.
Good luck
Thomas.
 
Sridhar Raman
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Thomas, for your response. It is very helpful.
 
I don't even know how to spell CIA. But this tiny ad does:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic