Spring - Hibernate


How can we setup Session Factory to integrate Spring and Hibernate?

Hibernate SessionFactory can be configured as a spring bean:

<bean id="mySessionFactory" class="org.springframework.org.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource" ref="specificDataSource"/>
  <property name="mappingResources">
  <property name="hibernateProperties">

Datasource can be created from JNDI

  <jee:jndi-lookup id=" specificDataSource " jndi-name="java:com/env/jdbc/specificds"/>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License