【Smart插件】smart-plugin-mybatis 介绍
smart-plugin-mybatis 是Smart框架的一个Mybatis插件,使用这个插件你可以比较方便的使用Mybatis。 这里主要介绍如何在Smart中使用该插件。 smart-plugin-mybatis插件将mybatis的配置信息从mybatis-config.xml转移到了smart.properties,该插件目前提供了几个主要的配置选项,其他比较常用的会看情况添加。 首先 使用Mybatis需要配置数据库连接,在Smart中不需要额外的配置,只需要使用Smart原有的配置内容: jdbc.type = mysql jdbc.driver = com.mysql.jdbc.Driver jdbc.url = jdbc:mysql://localhost:3306/sample jdbc.username = root jdbc.password = root 在Smart中配置的数据库,仍然可以使用Smart自带的DataSet操作数据库。 接下来是Mybatis独有的配置,首先是Mybatis的别名(Aliases)配置,插件支持以下两种别名配置方式: mybatis.aliases.package.pk1 = com.smart.sample.entity mybatis.aliases.package.pk2 = com.smart.sample