This content has been marked as final.
Show 2 replies
-
1. Re: Inherrit a CMP bean
sursha Sep 13, 2002 6:02 PM (in response to erikture)You can do inheritance. You have to use same Key class.
I mean you cant have base class's ejbCreate() return one primary key class and child class's ejbCreate() return another key class. You know in Java you cant override a method whose signature is different only in return type.
Extend your remote interface and bean implementation classes. Implement ejbCreate() in only one bean class.
Problem with inheritance approach is that you end up doing multi-table mapping if you have more cmp fields in child class. -
2. Re: Inherrit a CMP bean
dsundstrom Sep 13, 2002 11:55 PM (in response to erikture)I suggest you use delegation (encapsulation) instead of inheritance as your relationships won't inherit.