I would like to figure out how to configure a parent for a bean so that the container takes care of injecting the dependencies automatically without having to overwrite the setters of the parent (which is what I am currently doing) perhaps this is the intension but it would be nice if the container took care of it for me.
sample xml configuration
I configure by chileBean as follows and I don't want to have to overwrite the setter(s) of the parent.Code:<bean id="parentBean" class="com.example.beans.ParentBean" abstract="true"> <property name="someServiceBean" ref="someServiceBean"/> </bean> <bean id="childBean" class="com.example.beans.ChildBean" parent="parentBean"/>
PS. I found @DependsOn but I don't think it is meant for configuring bean inheritance. I would expect @Parent or something along those lines.Code:@Component public class ChildBean extends ParentBean { @Overwrite @Autowired public void setSomeServiceBean(final SomeServiceBean service) { super.setSomeServiceBean(service); }


Reply With Quote
