Hi ranchers,
Just want to know how to integrate spring & hibernate in an web application.I googled and found the following.
1. Configuring webapplicationcontext as a context listener in web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
In one of applications which we support they have used spring,hibernate &
EJB also.But, i was not able to find the above configuration in web.xml.Rather i found something as follows:
<bean id="UserEJBBean" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName">
<value>ManageUserEJBJNDI</value>
</property>
<property name="businessInterface">
<value>.....<package>..............ManageUserEJB</value>
</property>
<property name="lookupHomeOnStartup" value="false"/>
</bean>
I can understand from the above code, that "SimpleRemoteStatelessSessionProxyFactoryBean" is used for JNDI lookup.
From the managed bean,the lookup is as follows: Mangedbean --> EJB --> (service layer) Interface --> Impl --> DAO (Interface & Impl) --> Hibernate --> DB etc..
Now, my doubt is how spring is integrated with hibernate here?? Is there any other way??
I am really confused.
Please, please help me understand.
Thanks a lot for your time