Compatible with: IntelliJ IDEA Android Studio
May 16, 2018
186 686

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 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.

Download plugin

Recent change notes

v3.61

Implemented enhancements:
  • Adapt for IntelliJ IDEA 2018.2.
v3.60

Implemented enhancements:
  • Performance improvement.
  • Improve PE language lexer.
  • Rename mapper XML when mapper interface get renamed if their file names pattern match.
  • We can now extract SQL statement as sql tag in mapper XML (Same shortcut as extracting method).
  • We can now inline sql tag in mapper XML (Same shortcut as inlining method).
  • Add more inspections and quick fixes for mappers.
  • Don't insert 'resultType' attribute if determined type comes from package 'java.util' in mapper XML.
  • Support more DTD in mapper XML
  • Better mapper XML indexing.
  • Other minor improvements.
Fixed bugs:
  • The plugin stops working after few hours.
  • IDE hangs when startup because of the plugin.
  • The plugin slows down the IDE a lot.
  • The plugin does not work well sometimes because of API compatibility.
  • Fix 'java.lang.ClassNotFoundException' issue.
  • Fix 'java.lang.NullPointerException issue.
  • The plugin provides wrong completions sometimes in mappers.
v3.59

Implemented enhancements:
  • Inspect database context for mybatis generator.
  • Scan Spring Boot properties/yml configuration file.
  • Change the order of generated attributes of XML statement for better readability.
  • Cache xml and class namespace processor.
Fixed bugs:
  • Some common properties are highlighted as errors in Mybatis configuration file.
  • The plugin was broken on Ubuntu.
  • Fix annotation namespace scan issue.
v3.57

Implemented enhancements:
  • We can now invoke Mybatis generator from both project view popup menu and editor popup menu.
  • Stability and performance improvements.
  • Update replacing dot arithmetic.
  • Use statement method to determine if left curly braces exist.
  • Inject annotation statement with newline suffix.
v3.53

Implemented enhancements:
  • Merge improvements for v2018.1 into v2017.3.
v3.52

Implemented enhancements:
  • Optimize mapper index.
  • Group file templates.
  • Cache file type.
Fixed bugs:
  • Can't crate file from file templates.
v3.5

Implemented enhancements:
  • Adapt for IntelliJ IDEA 2018.
  • Replace internal API with open API.
  • Minor performance improvement.
Fixed bugs:
  • Minor bug fix.
v3.42

Fixed bugs:
  • Plugin didn't work well on Windows.
  • OGNL was broken.
v3.4

Implemented enhancements:
  • Support SQL injection in array values in annotation for complex SQL statement.
  • Auto-folding SQL statement in annotation to make it more readable.
  • You're suggested to use '[Mybatis] Edit SQL Fragment' intention action which takes care of mapper context to edit SQL statement in annotation.
  • You can now use IDEA proxy to activate the plugin.
  • SQL parameters won't be marked as error anymore if any map parameter is present in mapper method.
Fixed bugs:
  • @MapKey did't work well.
  • Memory leak.
  • Wrong namespace model in annotation.
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.