The plugin injects SQL language into various elements automatically which makes it easier to edit SQL. Injected SQL becomes much more powerful when integrated with Parameter Language. You can find more details about language injection here.
Some features are available as soon as SQL dialect is configured, so you'd better configure the SQL dialect for your project. You can find more details about how to configure SQL dialect here.
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. You can find more details at Annotation Folding.
When you extract a duplicated SQL segment into
sql tag, for instance:
<sql id="count"> count(*) </sql> <select id="countAdmin" resultType="int"> SELECT <include refid="count"/> FROM admin </select> <select id="countProject" resultType="int"> SELECT <include refid="count"/> FROM project </select>
There is an inspection error at
count(*) saying that "<statement> or DELIMITER expected, got 'count'",
that's because of
count(*) is not a legal SQL statement itself.
You can get rid of this error by following File → Settings → Language Injections → iBatis3 and remove
sql from local name field:
SQL will not be injected for
sql tag automatically anymore after you do this.
This is a solution to solve the issue mentioned above but it's not suggested to do so because it's not uncommon to write a legal SQL statement in sql tag,
you will completely lose the opportunity to check your SQL syntax in sql tag.
Codes Magic © 2013-2018 · Terms