Hibernate 4.3.5 + Spring 4.0.5

	<bean id="sessionFactory" lazy-init="true"
	      class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<!--<property name="mappingLocations">-->
			<!--<list>-->
				<!--<value>classpath:/hibernate/**/*.hbm.xml</value>-->
			<!--</list>-->
		<!--</property>-->
		<property name="packagesToScan" value="image.exifweb.persistence"/>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
				<prop key="hibernate.jdbc.batch_size">20</prop>
				<prop key="hibernate.show_sql">false</prop>
				<prop key="hibernate.format_sql">true</prop>
				<prop key="hibernate.validator.autoregister_listeners">false</prop>
				<!--<prop key="hibernate.hbm2ddl.auto">update</prop>-->
				<!--
				<prop key="hibernate.id.new_generator_mappings">true</prop>
				<prop key="hibernate.current_session_context_class">jta</prop> -->
				<!--<prop key="javax.persistence.validation.mode"></prop>-->
			</props>
		</property>
	</bean>

	<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
	<bean id="transactionManager" name="transactionManager"
	      class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory"/>
	</bean>

	<tx:annotation-driven mode="aspectj"/>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.