//mybatis配置
<?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>
<!-- 设置log4j-->
<settings>
<setting name="logImpl" value="LOG4J"/>
<!-- 通过配置这个属性为 true 可以自动将以下画线方式命名的 数据库列映射到 Java 对象的驼峰式命名属性中-->
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!-- 配置别名-->
<typeAliases>
<package name="org.simple.model"/>
</typeAliases>
<!-- 配置数据源-->
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"></transactionManager>
<dataSource type="UNPOOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/sell"/>
<property name="username" value="root"/>
<property name="password" value="root"/>
</dataSource>
</environment>
</environments>
<!-- 多数据库支持-->
<databaseIdProvider type="DB_VENDOR">
<property name="SQL Server" value="sqlserver"/>
<property name="DB2" value="db2"/>
<property name="Oracle" value="oracle"/>
<property name="MySQL" value="mysql"/>
<property name="PostgreSQL" value="postgresql"/>
<property name="Derby" value="derby"/>
<property name="HSQL" value="hsqldb"/>
<property name="H2" value="h2"/>
</databaseIdProvider>
<mappers>
<!-- <mapper resource="org/simple/mapper/WorksMapper.xml"/>-->
<!-- <mapper resource="org/simple/mapper/SysUser.xml"/>-->
<!-- <mapper resource="org/simple/mapper/SysRole.xml"/>-->
<!-- <mapper resource="org/simple/mapper/SysUserRole.xml"/>-->
<package name="org.simple.mapper"/>
</mappers>
</configuration>
//log4j配置
#全局配置
log4j.rootLogger = ERROR, stdout
#Mybatis配置
log4j.logger.org.simple.mapper=TRACE
#控制台输出配置
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n