Beans.xml Configuration content:
<?xml version= "1.0" encoding= "UTF-8"? ><beans xmlns= "http://www.springframework.org/ Schema/beans "xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "xmlns:context="/HTTP/ Www.springframework.org/schema/context "xmlns:tx=" Http://www.springframework.org/schema/tx " xmlns:aop=" Http://www.springframework.org/schema/aop "xmlns:mvc=" Http://www.springframework.org/schema/mvc "xmlns:jee=" http ://www.springframework.org/schema/jee "xsi:schemalocation=" http://www.springframework.org/schema/mvchttp:// www.springframework.org/schema/mvc/spring-mvc-3.1.xsdhttp://www.springframework.org/schema/tx http:// www.springframework.org/schema/tx/spring-tx-3.0.xsdhttp://www.springframework.org/schema/aop http:// www.springframework.org/schema/aop/spring-aop-3.0.xsdhttp://www.springframework.org/schema/beans http:// www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/context Http://www.springframework.org/schema/context/spring-context-3.0.xsdhttp://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/ Spring-jee-3.0.xsd "><!-- Open annotation-based configuration &NBSP;--><CONTEXT:ANNOTATION-CONFIG/><AOP: aspectj-autoproxy /><!-- Open Components Auto-scan --><context:component-scan base-package= " Org.rsun.ams "/><!-- Read External properties file --><context:property-placeholder location=" Classpath:d Atasource.properties "/><!-- Configure Data source --><bean id=" DataSource " class=" Com.alibaba.druid.pool.DruidDataSource " init-method=" Init " destroy-method=" close "><!-- Number of initialized connections; --><property name= "initialsize" value= "0" /><!-- max concurrent Connections -- ><property name= "maxactive" value= " /><!-- Maximum number of idle connections --><property name= "Maxidle" value= " /><!-- Minimum number of idle connections --><property name=" Minidle " value=" 0 " /><!-- Maximum wait duration --><property name= "maxwait" value= "60000" /><!-- exceeds time limit for recycling --> <property name= "removeabandoned" value= "true" /><!-- exceeding time limit how long; -->< Property name= "Removeabandonedtimeout" value= "/><!-- Data Source connection parameter configuration; -->< Property name= "username" value= "${username}"/><property name= "url" value= "${url}"/ ><property name= "Password" value= "${password}"/><property name= "DriverClassName" value= "${driverclassname}"/></bean><!-- Configuration sessionfactory --><bean id= " Sessionfactory " class=" Org.springframework.orm.hibernate4.LocalSessionFactoryBean "><property Name= "DataSource" ref= "DataSource"/><property name= "Packagestoscan" value= " Org.rsun.ams.core.model "/><property name=" hibernateproperties "><props><prop key=" Hibernate.dialect ">${hibernate.dialect}</prop><prop key= "Hibernate.show_sql" >${hibernate.show_sql}</prop><prop key= " Hibernate.hbm2ddl.auto ">${hibernate.hbm2ddl.auto}</prop><prop key=" Hibernate.format_sql ">$ {hibernate.format_sql}</prop></props></property></bean><!-- Configuration transaction manager -- ><bean id= "TransactionManager" class= " Org.springframework.orm.hibernate4.HibernateTransactionManager "><property name=" Sessionfactory " ref= "Sessionfactory"/></bean><!-- defining facets --><aop:config><aop:pointcut expression= "Execution (* org.rsun.ams.service.*.* (..))" id= "Txpointcut"/><aop:advisor advice-ref= "Txadvice" pointcut-ref= "TxPointCut"/></ aop:config><!-- Declarative transaction --><tx:advice id= "Txadvice" transaction-manager= " TransactionManager "><tx:attributes><tx:method name=" add* " propagation=" REQUIRED "/> <tx:method name= "remove*" propagation= "REQUIRED"/><tx:method name= "update*" propagation= "REQUIRED"/ ><tx:method name= "init*" propagation= "REQUIRED"/><tx:method name= "*" read-only = "true" propagation= "REQUIRED"/></tx:attributes></tx:advice><!-- Open transaction annotations <TX: Annotation-driven transaction-manager= "TransactionManager"/> --> </beans>
SPRING3 Integrated Hibernate4