Yes to 1 and part of 3.
As for 2), if you're using XDoclet to generate everything from the bean class, I found that for it to work correctly, my base class had to implement EntityBean, and also I had to provide a MyBaseClassHome interface which was just an empty interface (otherwise XDoclet would generate a bunch of incorrect stuff).
As for 3, if you're using XDoclet, you can put the tags for the shared persistent fields in the base class bean class and it will do the right thing for the subclasses and deployment descriptors.
Dave
| <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 06/06/2003 09:52 AM
|
To: <[EMAIL PROTECTED]> cc: Subject: [JBoss-user] CMP2.0 and inheritance. |
Hi folks,
If I have an entity bean say ManEJB that inherits from the person class, what restrictions
must be imposed on the superclass in order for the inheritance to be valid?
Maybe if someone could get perhaps answer the following quick questions if they had the time that would be fantastic.
1. Must the superclass also be declared abstract?
2. Must the superclass implement EntityBean?
3. Must the superclass's fields I wish to persist be declared in the normal fashion?
i.e. with abstract accessor methods and the <cmp-field> elements in the descriptor of the subclass?
Thanks,
Mark.
