iBATIS/MyBatis mini-plugin

Compatible with  IntelliJ IDEA
31 109
Simple iBATIS/MyBatis plugin
Contains essential features only, no datasource integration (yet)
Works for IDEA >= 10.0.3

Download plugin

Recent change notes

  • Find Usages of Spring beans exception fixed
  • Call Hierarchy support for sqlMap statements
  • Fixed ClassCastException for groovy strings
  • Copy Reference support for sqlMap statements
  • Not fully qualified statement names support
  • Red circle of death fixed when you had some empty namespaces and invoked auto completion
  • Multiple dots in fully qualified statement name support
  • Any string literal is a reference now
  • Computing concatenations for literals
  • Better File Structure popup presentation
  • Better mapper file navigation
  • Mapper method definition inspection
  • result resultMap attribute support
  • Occasional StringIndexOutOfBoundsException fixed
  • parameterMap attribute support
  • selectKey resultClass attribute support
  • Quick Documentation for statement names in Java code
  • Support for sqlMaps with no namespace attribute defined
  • Better sqlMap file navigation
  • Error on background mapper detection fixed
  • Resolving multiple statements with same namespace and id
  • include tags support
  • typeAlias support
  • MyBatis 3 proxies - Go to Implementation for proxy methods jumps right into xml declaration for the mapper method
  • Find Usages for sqlMap statements. Finds self-reference as well, that should be fixed
  • Showing clickable gutter icons for mapper interface and their methods, no Go to Implementation hotkey support yet
  • Searching for sqlMaps and mappers in libraries as well
  • Go to Declaration for string literals in method arguments
  • Autocompletion of statement names in string literals in method arguments
aupadhye, sql navigation is out of scope of this plugin. Maybe default IDEA SQL Support plugin can do that, I don't know. Jetbrains Devnet is a nice place to ask such questions: http://www.jetbrains.com/devnet/idea/
I liked the ability to navigate to iBatis XML file. But it doesn't navigate from XML to the Stored Procedure definition in SQL file. Is it outside the scope of this plugin? Do you know any other plugin (may be related to SQL) which supports this?
thank you! works perfectly!
Hope, I fixed kravovich's issue in IDEA 10. Now unqualified names detect statements even if their sqlMap namespace is set.
kravovich, the feature you describe should work. Could you please send a sample project that reproduces the problem?
navigation works only for names with namespaces eg "MyNamespace.mySelect" works but "mySelect" does not work
Thank you, Max!
MyBatis support is pretty limited at the moment mostly because I don't use MyBatis in my projects and not very interested in MyBatis support myself. However, you can post you suggestions to plugin page on GitHub https://github.com/ishchenko/idea-mini-ibatis/issues and I will implement them, or you can implement yourself and provide pull request for me.
Thanks for the plugin!

I am using MyBatis 3 and frankly I do not understand most of the described features.

The navigation from mapper interface method to XML tag is very, very nice and welcome.

What other features does the plugin offer for MyBatis 3 used exclusively with mapper interfaces and xml?

I do have tons of ideas regarding auto-completion, inspections, ...
If you have problems with 1.4, I suggest invalidating caches. It fixed the problem for me. Looks like, IDEA uses DomElement fqn when indexing DomElements, if fqn changes (it had in 1.4) old indexes would not detect new DomeElement's location.
Yea, but looks like non-empty namespace support is broken in 1.4 )) I will fix it asap.
The changes from 1.3 (multiple files because of supporting multiple databases) and 1.4 (namespace not required) work great.

jordandev, thanks for suggestions, your requests will be implemented!
Also, it seems when I have two statements with the same namespace/id one overwrites the other? Would it be possible to instead map both for Go To and be given a choice of which file to jump to?

I have these multiple statements because of having to handle both Oracle and SQL Server specific statements.
It seems to be working now with 1.1? Odd because some of them were not in a library. Anyways I find this very useful as having to search on the statement name every time was getting old.

Anyways, I don't use namespaces. Is it possible to add the statements without the namespace prefix when useStatementNamespaces is not set for that sqlMap?

And to be able to toggle whether we want it to pick up statements from libraries? As some of my projects use a ton of libraries and I don't want to see everything.

Sorry to want to overcomplicate the plugin ha.
Please  sign in  to leave a comment.