补充---Mybatis的配置文件中的settings和typeAliases标签

mybatis中的全局配置文件:
在配置文件中写配置一定要注意标签的先后顺序,顺序不对则配置文件不能运行
xml version="1.0" encoding="UTF-8" ?>
configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

<settings>

<setting name="cacheEnabled" value="true"/>

<setting name="logImpl" value="STDOUT_LOGGING"/>
settings>


<typeAliases>
<typeAlias type="com.aaa.entity.Dept" alias="Dept"/>
<typeAlias type="com.aaa.entity.Emp" alias="Emp"/>
typeAliases>

<environments default="mysql">

<environment id="mysql">
<transactionManager type="JDBC"/>

<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>

<property name="url" value="jdbc:mysql://localhost:3306/hbb?allowMultiQueries=true"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
dataSource>
environment>
environments>

<mappers>
<mapper resource="com/aaa/dao/DeptMapper.xml"/>
<mapper resource="com/aaa/dao/EmpMapper.xml"/>
mappers>

configuration>

你可能感兴趣的:(补充---Mybatis的配置文件中的settings和typeAliases标签)