java - Spring not injecting DAOs into JSF managed beans with abstract superclass -
i have jsf 2.0 application , integrating spring can make use of hibernatetemplate. consulted spring documentation on jsf integration , have taken steps set up. of bean classes extend abstract super class called superbean. superbean desired point of injection, saving me having declare of beans in spring. hoping declare abstract="true" , subclass bean extending superbean class have dao injected. @ runtime null.
<bean id="servicetemplate" class="org.springframework.transaction.interceptor.transactionproxyfactorybean" abstract="true"> <property name="transactionmanager" ref="transactionmanager"/> <property name="transactionattributes"> <props> <prop key="*"/> </props> </property> </bean> <bean id="daoservicetarget" class="com.example.service.daoservice"> <property name="maindao" ref="maindao"/> </bean> <bean id="daoservice" parent="servicetemplate"> <property name="target" ref="daoservicetarget"/> </bean> <bean id="superbean" class="com.example.beans.superbean" abstract="true"> <property name="daoservice" ref="daoservice"/> </bean> am able declare superclass superbean , expect spring inject dao? don't want have declare every bean class in spring.
i suppose alternative option (from performance perspective) not use spring beans declare dao's @applicationscoped , inject them superbean class using jee's cdi. better performance-wise?
in example above looks servicetemplate providing example of want. note parent="servicetemplate". need similar inherit superbean. there other options since have working code in servicetemplate might best place start. read here more details:
Comments
Post a Comment