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

猜你喜欢

转载自www.cnblogs.com/cag2050/p/12019677.html