mybatis异常 :元素内容必须由格式正确的字符数据或标记组成。
2015-08-27 10:54
288 查看
今天同事写一个查询接口的时候,出错:元素内容必须由格式正确的字符数据或标记组成。
错误原因: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]]>
错误原因: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]]>
相关文章推荐
- Opencv的LUT函数-查表操作
- 二年级开学倒计时
- 《HTML5从入门到精通》中文学习教程
- 8.5.1 Optimizing Storage Layout for InnoDB Tables InnoDB表的存储布局优化
- 组合模式
- [Boost]用asio编写简单的socket通信程序
- IOS改变状态栏颜色以及隐藏状态栏
- java 编程思想之7.2.1初始化基类
- 个人环境搭建——搭建tomcat
- win10 enterprise 10240激活:
- 事件函数块的返回值https://msdn.microsoft.com论述
- 建立git服务器
- poj3311Hie with the Pie【状压dp 类TSP】
- js实现的早期滑动门菜单效果代码
- sqoop导入数据到关系型数据库到hive
- hdoj 1130 How Many Trees? 【卡特兰数】
- 获取电脑的开机时间NtQuerySystemInformation
- Android--SharedPreferences
- Leetcode: Reverse Bits
- php 的哲学和python的哲学