Ibatis, as a semi-automated ORMapping tool, is becoming more and more people tend to use it in projects. Because SQL is often used with xml specifications
Ibatis, as a semi-automated OR Mapping tool, is becoming more and more people tend to use it in projects. Because SQL is often used with xml specifications
Ibatis, as a semi-automated OR Mapping tool, is becoming more and more people tend to use it in projects. Because SQL statements often conflict with xml specifications, the validity of xml ing files is affected. Many people know how to use Mark to avoid conflicts, but some details need special attention when there are dynamic statements in the SQL configuration.
When using ibatis, you often need to configure the SQL statement to be executed. Anyone who has used ibatis knows that, inevitably, some incompatible and conflicting characters will be encountered. Most people also know that ibatis is used. Mark to prevent the legality of the xml ing file from being affected by characters that conflict with xml specifications in SQL. However, when using dynamic statements in ibatis, you still need to pay attention to some details. The following is an example:
Environment: Oracle, ibatis, java
Error Example 1: The symbol "<=" may affect the validity of the xml ing file.
Error Example 2: Use the entire SQL statement Tag to avoid conflicts, which is generally feasible. However, because the SQL configuration contains a dynamic statement (where part), the system cannot identify the dynamic part, the entire SQL statement is invalid.
Correct practice: narrow down the scope and only adjust the validity of the conflicting characters.
Summary:
When using CDATA, you only need to include the code that may cause conflicts. Do not blindly include the code.