mybatis異常 :元素內容必須由格式正確的字元資料或標記組成。,mybatis字元

來源:互聯網
上載者:User

mybatis異常 :元素內容必須由格式正確的字元資料或標記組成。,mybatis字元

今天同事寫一個查詢介面的時候,出錯:元素內容必須由格式正確的字元資料或標記組成。


錯誤原因:mybatis查詢的時候,需要用到運算子 小於符號:< 和  大於符號: >,在mybatis設定檔裡面,這種會被認為是標籤,所以解析錯誤

錯誤案例:

select  <include refid="Base_Column_List" /> from t_time_interval where  status <> 99  and time_intvl_id >=29 and time_intvl_id <=45  order by time_intvl_id



解決辦法:

select  <include refid="Base_Column_List" /> from t_time_interval where  <![CDATA[ status <> 99  and time_intvl_id >=29 and time_intvl_id <=45  order by time_intvl_id]]>


著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.