Inheritance in EJBs is tricky to understand because of the many classes and interfaces involved. A simple rule of thumb to be aware of is to make sure that inheritance does not change the return types of the methods in the classes or interfaces. One example is of a child EJB inheriting the remote (or local) interface and home interfaces (remote or local) of an existing EJB. In this case, the child EJB has to ensure that the return type of the create() method is invoked on the bean's home interface object. Entity beans are a bit more restrictive in that to override an entity bean, the create() method must not return a primary key class that is different from the parent EJB's primary key class data type. |