SPRING3 Integrated Hibernate4

Source: Internet
Author: User

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;--&GT;&LT;CONTEXT:ANNOTATION-CONFIG/&GT;&LT;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 &LT;TX: Annotation-driven transaction-manager= "TransactionManager"/> --> </beans>


SPRING3 Integrated Hibernate4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.