编写实体类
编写对象配置文件 xxxMapper.xml
<!--加载properties文件-->
<properties resource="jdbc.properties"></properties>
<settings>
<setting name="lazyLoadTriggerMethods" value="toString()"/>
</settings>
<!--批量取别名-->
<typeAliases>
<package name="com.hezhe.pojo"/>
</typeAliases>
<!--environments: 运行环境-->
<environments default="development">
<environment id="development">
<!--当前的事务事务管理器是JDBC-->
<transactionManager type="JDBC"></transactionManager>
<!--数据源信息 POOLED:使用mybatis的连接池-->
<dataSource type="POOLED">
<property name="driver" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</dataSource>
</environment>
</environments>
<mappers>
<!--<mapper resource="com/hezhe/mapper/UserMapper.xml"></mapper>-->
<!--批量加载映射-->
<package name="com.hezhe.mapper"/>
</mappers>