Annotation folding

The Mybatis documentation says:

There are some annotations that represent the actual SQL that is to be executed.
They each take an array of strings (or a single string will do).
If an array of strings is passed, they are concatenated with a single 
space between each to separate them.
This helps avoid the "missing space" problem when building SQL in Java code.
However, you're also welcome to concatenate together a single string if you like

Your SQL statement in annotation may look like this which contains a lot of noising " \n + ,:

statement without folding

With the help of the plugin, your SQL statement becomes more readable like this:

statement with folding

You can write SQL in a annotation (e.g., @Insert) using a single string or using an array of strings. The plugin takes care of your choice.

Quick Edit

The plugin provides a custom Quick Edit intention action which takes care of mapper context to make it easier to edit complicated SQL statement:

quick edit

Let's see how it works in action:

in-action.gif

Note: Custom Quick Edit is also available in mapper XML, but it's more useful working with annotation.

Codes Magic © 2013-2018 · Terms