MyBatisCodeHelper

Compatible with: IntelliJ IDEA Android Studio
15.03.2017
8 533

GitHubIssues

特性

  • 支持mysql和oracle
  • 根据java对象生成mybatis crud代码和建表sql

  • 根据mybatis接口中的方法名生成mybatis的sql 支持find,update,delete,count方法 只需定义一个方法名就可以得到完整mybatis xml代码 可生成大部分单表操作sql 极大提升效率

  • mybatis接口文件的mapper xml之间的相互跳转

  • 数据库对象更新后一键更新对应的Sql和mybatis xml文件

  • 默认提供insert,insertSelective,insertList,update。因为delete可以由方法名生成 默认不提供

  • 提供mybatis接口方法名的重构

  • refid, resultMap跳转到到定义,支持重命名
  • refid,resultMap,keyProperty,property的自动补全
  • mybatis mapper xml文件sql的自动补全

使用方法

  • 在数据库对象上使用alt+insert (generate mybatis files)来生成crud代码和建表sql(mac上使用ctrl+N)

  • 数据库对象添加字段后使用alt+insert (generate mybatis files) 来生成更新sql,mapper xml中的字段

  • 在mybatis接口的方法名上使用alt+enter来生成对应的mapper sql

  • 详细配置: https://github.com/gejun123456/MyBatisCodeHelper

  • qq群:542735959

Features

  • Generate mybatis crud and create table sql according to domain class
  • Generate mybatis sql based on mybatis interface method name, with this, you don't have to write most sql for non join query,support with method name start with find,update,delete,count

  • Jump from mybatis dao interface to mapper xml each other

  • generate files provide insert, insertSelective,insertList,update. others can be generated by methodName

  • refactor for mybatis interface method name

  • jump from refid resultMap to their definition, refactor their name as well

  • mybatis mapper sql auto completion

  • refid,resultMap,keyProperty,property auto complete
  • Support java + MySQL and Oracle and later will support more DB.

  • https://github.com/gejun123456/MyBatisCodeHelper to learn more.

How to use

  • alt+insert (generate mybatis files) on domain class to generate mybatis files (ctrl+N on mac)
  • alt+insert (generate mybatis files) on domain class to update mybatis files when domain class add field (ctrl+N on mac)
  • alt+enter on dao interface method to generate mybatis mapper sql
  • view more on https://github.com/gejun123456/MyBatisCodeHelper

Download plugin

Recent change notes

1.4.5
  • support with enum type

1.4.4
  • fix exception when start up

1.4.3
  • support multiple method xml generate
  • support for mybatis plus
  • support domain class with protected field and static field
  • support for small resolution
  • bugfix - fix can't generate to path

1.4.2
  • bugfix - fix Could not initialize class com.ccnode.codegenerator.freemarker.TemplateUtil

1.4.1
  • bugfix - oralce insertList
  • bugfix - import issue

1.4
  • add support for oracle
  • config use generate key
  • auto complete for resultMap,refid,keyProperty,property
  • support with java.sql.Timestamp java.sql.Date java.sql.Time Enum LocalDateTime LocalDate
  • support update field with insertSelective
  • add new icon of mybatis jump to xml ect

1.3
  • add index column and hasDefault column when generate mybatis files
  • jump from refid resultMap to their definition in mybatis xml. could refactor as well
  • could refactor method name in xml
  • add insertSelective when generate mybatis files
  • generate for greaterThanOrEqualTo and lessThanOrEqualTo and betweenOrEqualTo
  • add configuration to use with @Mapper
  • fix not null issue for find module - bug fix

1.2
  • add support for unsigned type, small int.
  • check for using object type instead of primitive type
  • support more auto completion for sql
  • double type support - bug fix
  • update field exception -bug fix

1.1 fix doc

1.0 use gradle, fix bugs.