mybatis-config.xml 知识点

typeAliases 标签:配置别名,主要用于 XML 文件中的 resultType 参数。

mappers 标签:配置所有的 mapper。

MyBatis 和 Spring Boot 配合使用时,2种配置方式,都是可以的。

第一种:在 application.properties 配置文件中配置,不用新建 mybatis-config.xml 文件。
第二种:配置 mybatis-config.xml,然后在 application.properties 指定该文件的路径:

mybatis.config-locations=classpath:mybatis/mybatis-config.xml

posted on 2019-12-10 22:39  cag2050  阅读(139)  评论(0编辑  收藏  举报

导航