Escape characters in MyBatis Sql statement

1. In the sql statement of xml, you cannot directly use the greater-than sign and the less-than sign to use escape characters

If the less than sign is used, an error will be reported as follows:

org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

escape character

 

                     <                                 

                     <

                     Less than sign                                           

                     >

                     >                                      

                     greater than sign

                     &

                     &

                     and

                     '

                     ’

                     apostrophe

                     "

                     "

                     Double quotes

Note:
Tags such as <where> <if> in SQL statements marked with <![CDATA[ ]]> will not be parsed

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324910366&siteId=291194637