I have one fundamental question on dependency injection.
Assuming I have two beans definition
Code:
<bean id="SessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
scope="singleton" lazy-init="false">
<bean/>
Code:
<bean id="ObjectMain"
class="com.test.testSpring"
scope="prototype" autowire="constructor" lazy-init="false">
<constructor-arg index="0" value="SessionFactory" />
</bean>
Now if this class testSpring object is created using the getBean call of the ClassPathXMLApplicationContext and if there are two constructor one with no parameters and one with SpringFactory as a parameter which one shall be called?
I am asking this coz I have tried Autowiring the overloaded constructor with the SessionFactory object as it still does not calls the overloaded constructor.
Any help?