In mybatis analysis

When using mybatis, our SQL is written in the XML Mapping file. If there are some special characters in the written SQL, it will be escaped when parsing the XML file, but we don't want it to be escaped, so we want to use .

what is it? It's XML syntax. Everything inside CDATA is ignored by the parser.

If the text contains a lot of "<" characters < = and "&" characters -- just like program code, it's best to put them all in the CDATA part.

However, there is a problem that < if test = "" > < / if > < where > < / where > < choose > < / choose > < trim > < / trim > these tags will not be parsed, so we only put the statements with special characters in minimize .

Examples are as follows:

Because there are ">" < = "special characters here, use to comment, but there is a < if > tag, so put < if > outside

summary

The above is the I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>