hibernate与spring整合的配置文档问题详解编程语言
context:component-scan base-package= com.wang / [email protected]
context:annotation-config/ 提供注释
! aop:aspectj-autoproxy/
!
aop:config AOP配置
aop:pointcut id= servicePointcut expression= execution(public * com.wang.service.UserService..*.add(..)) /
aop:aspect id= logAspect ref= logInterceptor
aop:before method= before pointcut-ref= servicePointcut /aop:before
/aop:aspect
/aop:config
aop:config
aop:pointcut id= daoPointcut expression= execution(public * com.wang.dao..*.*(..))) /aop:pointcut
aop:aspect id= logAspect ref= logInterceptor
aop:before method= before pointcut-ref= daoPointcut /aop:before
/aop:aspect
/aop:config
aop:config
aop:pointcut id= bussinessService expression= execution(public * com.wang.service..*.*(..)) /aop:pointcut
aop:advisor advice-ref= txAdvice pointcut-ref= bussinessService /aop:advisor
/aop:config
bean id= UserService >
bean id= userDao >
bean id= logInterceptor >
bean id= logDao >
bean id= hibernateTemplate > property name= sessionFactory ref= mySessionFactory /property
/bean
bean id= dataSource >
property name= driverClassName value= com.mysql.jdbc.Driver /property
property name= url value= jdbc:mysql://localhost:3306/db_wind /property
property name= username value= root /property
property name= password value= 1234 /property
/bean
bean id= mySessionFactory > property name= dataSource ref= dataSource /property
!
property name= mappingResources
list
value com/wang/model/Log.hbm.xml /value
value com/wang/model/User.hbm.xml /value
/list
/property
property name= packagesToScan 自动到包下查找hibernate注释的model
list
value com.wang.model /value
/list
/property
property name= hibernateProperties hibernate属性配置
props
prop key= hibernate.dialect
org.hibernate.dialect.MySQLDialect
/prop
prop key= hibernate.show_sql
true
/prop
/props
/property
/bean
bean id= txManger > property name= sessionFactory ref= mySessionFactory /property
/bean
! tx:annotation-driven transaction-manager= txManger /tx:annotation-driven
tx:advice id= txAdvice transaction-manager= txManger
tx:attributes
tx:method name= add* propagation= REQUIRED /
/tx:attributes
/tx:advice
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/11240.html
cjavamysqlxml相关文章
- Spring学习笔记(三)——Spring注解开发&spring与Junit整合测试
- spring boot自动配置原理面试题_Spring boot面试
- Spring学习笔记(十八)——spring日志框架的配置和使用
- spring boot整合shiro_Spring框架介绍及使用
- 斗转星移,无人能及——Spring MVC
- 中高级程序员可能都不会使用spring-boot-starter-jdbc访问MySQL
- Spring Boot基础配置之属性配置
- springboot 集成mybatis-plus_Spring Boot
- ElasticSearch全文搜索引擎 -Spring Boot操作ES(SpringData概述、Spring Data Elasticsearch、基本操作、ElasticSearch操作文档)
- Spring Cloud Gateway 的架构和核心组件(一)
- Spring Data MongoDB 查询指定字段详解数据库
- spring mongodb的常规配置详解编程语言
- Activiti工作流与spring集成详解编程语言
- Spring Boot 2.0官方文档之 Actuator详解编程语言
- Spring Boot2.0之 整合XXL-Job详解编程语言
- spring Boot(十九):使用Spring Boot Actuator监控应用详解编程语言
- Spring Boot(十三):spring boot小技巧详解编程语言
- Spring Boot(五):spring data jpa的使用详解编程语言
- java spring boot Swagger2 构建api文档详解编程语言
- Spring MVC的国际化
- Spring框架下整合Redis的实现(spring整合redis)