Compatible with: IntelliJ IDEA Android Studio
Nov 05, 2017
153 602

Plugin for Mybatis.

Plugin was rewritten from scratch with new architecture to make it more stable and bringing many new features.

The plugin provides the following features:

  • Compatible with both IDEA ultimate and community edition.
  • Code completion, syntax highlighting.
  • Smart SQL parameter completion based on SQL statement context.
  • Navigation (Jump to symbol, Find Usages, Refactoring)
  • Introduce custom 'Mybatis Parameter' language to support Mybatis parameter expression.
  • Generate Mapper XML, SQL statement, statement declaration on the fly.
  • Integrate with configured DataSource in IDEA.
  • Many useful code inspections with helpful quick fixes.
  • Many useful intention actions to make it easier to write code.
  • OGNL support.
  • Annotation support.
  • Spring support.
  • Spring Boot support.
  • Mybatis generator support.
  • [TBD]Detailed documentation.

Download plugin

Recent change notes

v3.22

Implemented enhancements:
  • Adapt for 2017.3 EAP.
v3.21

Implemented enhancements:
  • Mybatis generator support.
  • More annotations support.
Mybatis generator:
  • You can use 'classPathEntry' elements to add your external classes that extend one of MBG's classes or implement one of MBG's interfaces to MBG runtime classpath.
    The 'location' attributes of 'classPathEntry' elements will be probably used like this: 'java -jar mybatis-generator-core.jar -cp location_attribute_values_of_class_path_entry'.
  • All 'targetProject' attributes are not required because 'targetPackage' attributes will take care of everything.
  • Invoke 'Show Intention Actions' (Command + Return on Mac or Alt + Return on Windows) in generator config file and select '[Mybatis] Insert tables' to insert 'table' tag.
  • Invoke 'Show Intention Actions' (Command + Return on Mac or Alt + Return on Windows) in generator config file and select '[Mybatis] Run Mybatis Generator' to run it.
  • Existing generated files will always be overwritten by newly generated files, we believe it's a good practice decouple auto-generated files and manually-written files.
v3.154

Implemented enhancements:
  • Auto-detecting annotated type alias.
  • Auto-detecting alias package and properties in application properties/yml.
  • Add Mybatis configuration file template(New -> Mybatis -> New Configuration File).
  • Don't insert 'resultType' attribute if determined type comes from package 'java.util'.
  • Use type alias with 'parameterType' and 'resultType' attribute if type alias is present.
Fixed bugs:
  • SQL parameter completion according to 'parameterType' doesn't work well sometimes.
  • Mapper XML with iBatis DTD doesn't work well.
  • Suppress navigation of generic type.
  • Class with '@Mapper' annotation is not determined as mapper class.
v3.14

Implemented enhancements:
  • Change the icon of mybatis configuration file.
  • Hmm. You guys don't like 'Mybatis facet', let's get rid of it.
  • Add intention action to generate XML statement even if interface is not recognized as mapper interface.
  • Spring Boot support.
v3.13

Fixed bugs:
  • Minor bug fixes.
v3.12

Implemented enhancements:
  • Add more configuration detection.
Fixed bugs:
  • Xml statement navigates to wrong element.
  • Case insensitive alias was broken.
  • Can't find mapper bean in Spring
v3.11

Fixed bugs:
  • Apply some quick bug fixes.
v3.0

Implemented enhancements:
  • Plugin was rewritten from scratch with new architecture to make it more stable and bringing many new features.