Compatible with: IntelliJ IDEA Android Studio
Sep 02, 2018
253 859

Plugin for Mybatis.

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.
  • Generate SQL statement corresponding to Spring Data Jpa Specification.
  • 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

v4.04

Implemented enhancements:
  • Update `true' expression.
  • Update UpdateJpaExpression.
  • Add completions for static param without sql parameter parent.
  • Skip elements at current tag when walk dom tree up.
  • Introduce explaining method and for better performance.
v4.03

Fixed bugs:
  • Minor bug fix.
v4.02

Implemented enhancements:
  • Adapt for IntelliJ IDEA 2018.2.
v4.01

Implemented enhancements:
  • Generate SQL statement due to Spring Data Jpa Specification, you can find more details at User Guide.
  • Performance optimizations.
  • Update PE language.
  • Deprecate implicit usage provider.
  • Enlarge search scope for parameter only when it's in mapper class.
  • Reset SQL index when corresponding console text is cleared in console view.
  • Prevent possible memory leaks issue in AddStatement quick fix.
  • Use precise title to communicate intent for progress indicator.
  • Use newest API level and migrate internal code usage.
  • Stop indexing excluded files/directories.
Fixed bugs:
  • Fix class cast issue for reference contributor.
  • Fix multiple class resolve.
  • Access is allowed from event dispatch thread only.
v3.67

Fixed bugs:
  • 'Edit SQL statement' is broken on IntelliJ 2018.2.
  • External '\n' is present in migrated statement in XML mapper.
v3.66

Fixed bugs:
  • 'java.lang.ClassCastException' issue.
  • SQL concatenation doesn't work with Tomcat.
  • Go to mapper method from console view doesn't work sometimes.
v3.65

Implemented enhancements:
  • Show parameter type for parameter auto-completion.
  • Preserve icons for IntelliJ 2018.2.
  • Place extracted sql tag next to the tag where it's extracted.
  • Smart-copy concatenated SQL with actual parameters into the clipboard from console view.
  • We can now copy annotation statement into the clipboard.
  • We can now move annotation statement to XML mapper.
  • We can now move @Results annotation to resultMap in XML mapper.
  • Update text for all intention actions to make it more readable.
Fixed bugs:
  • Generated statement uses boxed type for primitive return type.
v3.62

Implemented enhancements:
  • Monitor Mybatis log and concatenate SQL with actual parameters as executable one in the console view, it's very helpful when debugging.
  • Edit, copy or run concatenated SQL directly in the console view.
  • You can also concatenate SQL manually by selecting Mybatis log and run 'Concatenate SQL' action in console output.
  • It's also possible to navigate to corresponding mapper method that produced the SQL.
  • Insert table columns by intention action to save you the time of typing one by one.
Fixed bugs:
  • Minor bug fix.
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.