spring整合mybatis的配置文件
来源:互联网 发布:质量好的挎包淘宝店 编辑:程序博客网 时间:2024/05/22 02:24
备忘
<?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:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsd"> <!--加载配置文件 --> <context:property-placeholder location="classpath:db.properties" /> <!-- 数据源 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="user" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="driverClass" value="${jdbc.driverClassName}" /> </bean> <!--sqlSessionFactory --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <!--省略sqlmapconfig.xml--> <!--<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"></property>--> <property name="mapperLocations" value="classpath*:com/zhmhxy/taotao/dao/*.xml"/> <!--另一种写法--> <!--<property name="mapperLocations" >--> <!--<list>--> <!--<value>classpath*:com/zhmhxy/taotao/dao/*.xml</value>--> <!--</list>--> <!--</property>--><property name="plugins"><!--参考:http://blog.csdn.net/estelle_belle/article/details/46356575--> <array> <bean class="com.github.pagehelper.PageHelper"> <!--分页工具,在sql语句发送前根据mysql方言拼接limit--> <property name="properties" > <value>dialect=mysql</value> </property> </bean> </array> </property> </bean> <!-- 管理mapper接口 --> <!-- <bean id="userMapper" class="org.mybatis.spring.mapper.MapperFactoryBean"> <property name="mapperInterface" value="com.zhmhxy.taotao.dao.UserMapper"></property> <property name="sqlSessionFactory" ref="sqlSessionFactory"></property> </bean> --> <!-- 使用mapper扫描管理所有的代理mapper --> <bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.zhmhxy.taotao.dao"></property> </bean></beans>
阅读全文
0 0
- spring整合mybatis的配置文件
- spring-mybatis整合(配置文件)
- mybatis整合spring配置文件
- spring整合mybatis的applicationContext.xml配置文件
- Mybatis整合Spring的配置文件样例
- Spring+SpringMVC+MyBatis整合配置文件的搭建
- Spring与Mybatis整合配置文件
- struts2 + spring + mybatis 整合配置文件
- spring与mybatis整合配置文件
- mybatis与spring整合配置文件
- spring mybatis整合读取配置文件
- spring+springmvc+mybatis整合配置文件
- 关于Spring与mybatis整合无法读取配置文件的问题
- 浅谈spring+springMVC+mybatis框架整合(配置文件的使用)
- Spring ,Springmvc,mybatis三大框架整合的配置文件支持
- spring 整合mybatis 出现解析不了配置文件的问题
- SSM整合(三) -- Spring和Mybatis的配置文件详解
- 整合SpringMVC+Spring+Mybatis+mysql的maven配置文件pom.xml
- Android图表 MPAndroidChart折线图
- 机器学习笔记5:TensorFlow的了解与运行
- C/C++ for VS Code
- mysql 主从复制
- 分类器设计
- spring整合mybatis的配置文件
- Mysql两种存储引擎的优缺点
- Spring+SpringMVC+Hibernate三大框架整合
- Linux epoll简单脉络
- 关于嵌入式的系统,原来自己知道的太少了
- C++文件操作——相对路径与绝对路径
- Java项目——简单的WebServer(二)
- 设计模式之单例模式
- SQL(DDL、DML)