【Mybatis-Plugin】Mybatis-Generator插件开发。根据个人需要
- mybatis-generator-plugins-javaBean/xmlMethod生成工具
- mybatis-generator-plugins-postgresql-批量更新
- mybatis-generator-plugins-oracle-批量更新
- mybatis-generator-plugins-mysql批量更新
- mybatis-generator-plugins-postgresql-返回主键
- mybatis-generator-plugins-oracle-返回主键
- mybatis-generator-plugins-oracle-批量插入
- mybatis-generator-plugins-mysql/postgresql-批量插入
- mybatis-generator-plugin-批量删除
需要新增批量操作的时候。有一个简易版插件。
- 在id上指定database
- targetRuntime指定Mybatis3
- 引入插件
- 判断是否自增,不加这个配置则是自己插入主键(适用于分布式系统)
<context id="Mysql" targetRuntime="MyBatis3" >
<!--批量操作-->
<plugin type="com.hui.mybatis.plugins.BaseBatchOperatorPlugin"/>
<generatedKey column="order_id" sqlStatement="JDBC" identity="id" />
- MYSQL:
com.hui.mybatis.plugins.BatchInsertPlugin - ORACLE:
com.hui.mybatis.plugins.OracleBatchInsertPlugin - POSTGRESQL:
com.hui.mybatis.plugins.BatchInsertPlugin
- MYSQL:
com.hui.mybatis.plugins.BatchDeletePlugin - ORACLE:
com.hui.mybatis.plugins.BatchDeletePlugin - POSTGRESQL:
com.hui.mybatis.plugins.BatchDeletePlugin
- MYSQL:
com.hui.mybatis.plugins.MysqlBatchUpdatePlugin - ORACLE:
com.hui.mybatis.plugins.OracleBatchUpdatePlugin - POSTGRESQL:
com.hui.mybatis.plugins.PostgreBatchUpdatePlugin
com.hui.mybatis.plugins.PostGreSQLReturnKeyPlugin
com.hui.mybatis.plugins.OracleReturnKeyPlugin
com.hui.mybatis.plugins.OverWriteXmlPlugin