mybatis配置文件

Posted Tsugar

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis配置文件相关的知识,希望对你有一定的参考价值。

mybatis-config.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
<properties resource="jdbc.properties"></properties>

<typeAliases>
<package name="com.blb.dto"/>
</typeAliases>



<environments default="mysql">
<environment id="mysql">
<transactionManager type="JDBC"></transactionManager>
<dataSource type="POOLED">
<property name="driver" value="${driver}"/>
<property name="url" value="${url}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
</dataSource>
</environment>
</environments>


<mappers>
<mapper resource="com/blb/mapper/UserMapper.xml"></mapper>
<mapper resource="com/blb/mapper/RoleMapper.xml"></mapper>
<mapper resource="com/blb/mapper/MenuMapper.xml"></mapper>
<mapper resource="com/blb/mapper/UserRoleMapper.xml"></mapper>
<mapper resource="com/blb/mapper/RoleMenuMapper.xml"></mapper>
</mappers>

</configuration>

以上是关于mybatis配置文件的主要内容,如果未能解决你的问题,请参考以下文章

Mybatis 系列2

Spring+SpringMVC+MyBatis+Maven框架整合

推荐学java——MyBatis高级

推荐学java——MyBatis高级

推荐学java——MyBatis高级

推荐学java——MyBatis高级