Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.440 :

Posted: Sun Jun 11, 2017 10:09 am
by johnlong
However, injection of such resources follows the Java language overriding rules for the visibility of fields and methods. A method definition that overrides a method on a superclass defines the resource, if any, to be injected into that method. An overriding method may request injection of a different resource than is requested by the superclass, or it may request no injection even though the superclass method requests injection.
Is this correct : If subclass overrides a method and changes the type of the resource injection, it will affect method of the superclass itself?

Re: About Question enthuware.oce-ejbd.v6.2.440 :

Posted: Sun Jun 11, 2017 9:27 pm
by admin
Yes, it is quoted from section 16.2.2 of EJB 3.1 specification.
It is not really affecting the method of superclass. It is affecting the subclass method that is inherited by the subclass. If you use the superclass as a bean, then changes in the subclass will have no affect.

Re: About Question enthuware.oce-ejbd.v6.2.440 :

Posted: Mon Jun 12, 2017 9:02 am
by johnlong
Clear. Thank you.