解决Mybatis的Tag name expected的问题
mapper文件中写sql语句时提示Tag name expected,找到原因是因为xml不识别<号需要用特定转义符来表示<号。
<select id="selectHavingOrtherResultNotYetProcessed" resultMap="BaseResultMap" >select<include refid="Base_Column_List" />from mark_resultwhere length(ai_json) < 180 and ai_json not like '{"gmtModified%' ANDai_json not like '{}' and code is null</select>
修改如下:
在 XML 中,一些字符拥有特殊的意义。
如果您把字符 "<" 放在 XML 元素中,会发生错误,这是因为解析器会把它当作新元素的开始。
这样会产生 XML 错误:
为了避免这个错误,用实体引用来代替 "<" 字符,如下:
<message>if salary <1000 then</message> 需要改为<message>if salary < 1000 then</message>
在 XML 中,有 5 个预定义的实体引用:
注意:在 XML 中,只有字符 "<" 和 "&" 确实是非法的。大于号是合法的,但是用实体引用来代替它是一个好习惯。
原文:https://blog.csdn.net/shichuwu/article/details/82561715
解决Mybatis的Tag name expected的问题相关推荐
- oracle大于号怎么用,解决MyBatis的mapper中SQL小于号或大于号报错-tag name expected
通常写SQL我们都会在Navicat里面写好条件测试没问题之后才会把SQL放到mapper里面,有次我在写Oracle的分页的时候因为用到了<=符号,在Navicat测试的时候是没问题的,但是放 ...
- mybatis的xml文件里提示Tag name expected的解决方案
mapper文件中写sql语句时最到报红,提示Tag name expected,找到原因是因为xml不识别<号>号需要用特定转义符来表示<号. 为了避免这个错误,用实体引用来代替 ...
- 解决MyBatis中 Could not set property ~ o f ~异常
解决MyBatis中 Could not set property ~ of ~ public class Role {private Integer id; //idprivate String r ...
- 解决mybatis中#{}导致的The error may involve defaultParameterMap的问题
解决mybatis中#{}导致的The error may involve defaultParameterMap的问题 参考文章: (1)解决mybatis中#{}导致的The error may ...
- 成功解决TypeError: sequence item 0: expected str instance, list found
成功解决TypeError: sequence item 0: expected str instance, list found 目录 解决问题 解决思路 解决方法 解决问题 TypeError: ...
- 成功解决TypeError: sequence item 0: expected str instance, bytes found
成功解决TypeError: sequence item 0: expected str instance, bytes found 目录 解决问题 解决思路 解决方法 解决问题 TypeError: ...
- 解决mybatis generator无法覆盖XML
转载自 解决mybatis generator无法覆盖XML 今天发现mybatis generator maven plugin在重复生成的时候xml文件只会merge,不会覆盖. 明明在pom. ...
- mybatis oracle 大写,解决mybatis用Map返回的字段全变大写的问题
mybatis通常情况都是用javabean作为resultType的对象,但是有时也可以使用Map去接收. ${value} 如果使用Map,返回来的字段名全是大写,处理方法 Select name ...
- mybatis多字段排序_解决mybatis中order by排序无效问题
1.#将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号.如:order by #{user_id},如果传入的值是111,那么解析成sql时的值为order by "111&qu ...
最新文章
- ScaleYViewPager
- iOS 导航栏实现总结
- 北斗导航 | 北三全球电离层延迟修正模型——BDGIM模型(附C源代码)
- newduba首页怎么去掉_京喜小程序首页瘦身实践
- Django框架之Filters(过滤器)、母版的使用
- kafka学习_Kafka 学习笔记01
- 主流开源开发者工具落地阿里云,进一步提升开发者体验
- Yii2所提倡的配置管理方案
- mysql case then效率快_详解Mysql case then使用
- [译]Chipmunk教程 - 5 跟踪球体的运动
- android mac 调试,Mac下使用Android studio真机调试
- PHP中使用数组转换成Json格式出现中文乱码解决方案
- UVM设置超时退出timeout
- Netty系列进阶篇一:阻塞和多路复用到底是个啥?
- Java汉字输入练习
- matlab——灰色预测
- SQL Server 数据库中的临时表
- 计算机网络基础之域名系统
- TP-LINK TL-WDN7200H ubuntu驱动安装
- 时间戳 与 Unix时间戳