Compatible with: IntelliJ IDEA Android Studio
Apr 03, 2018
156 993

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


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.

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.

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

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

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

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

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.

Implemented enhancements:
  • Adapt for 2017.3 EAP.

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.

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.

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.

Fixed bugs:
  • Minor bug fixes.

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

Fixed bugs:
  • Apply some quick bug fixes.

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