Hello,everyone! I'm new to spring, and find it very useful. In a web project, I annotated the DAOs, sevices and actions with @Repository, @Service, @Controller, and configure them using <context:component-scan base-package="sampl.x">.
I define a GenericDAO, which deals with getting sessions and CRUD processes. So any subclass just extends AbstractGenericDAO ( implements GenericDAO), and has CRUD ability. I know I can configure the bean inheritance relationship in a applicationContext.xml like this:
But in this way, I have to define a bean for every concret DAO in the xml file. I prefer the <context:component-scan. I wonder is threre a way to do this with annotations?Code:<bean id="abstractGenericDAO" abstract="true"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="testDao" class="sample.TestDaoImpl" parent="abstractGenericDAO" />
I appreciate any hints or reference![]()


Reply With Quote
