
SSM整合
整合Spring+SpringMVC+MyBatis的过程,和其中遇到的问题
小粥愚。
这个作者很懒,什么都没留下…
展开
-
order by field 和 order by INSTR 自定义排序(无序排列)
order by field 和 order by INSTR 自定义排序(无序排列) 问题场景: dao层传递一串id数组(eg:3,5,4,6,7),要求查询该id数组里面的所有对象,并按传入的顺序,返回成对象数组 遇到问题: 使用select * from table where id in (3,5,4,6,7) 这样可以查询出数据,但是它会默认的排序成(3,4,5,6,7) 执行默认排序: 直接使用IN来查询数据时,MySQL会自动的根据主键id来排序 SELECT * FROM `product原创 2020-07-24 22:59:34 · 1937 阅读 · 0 评论 -
The content of elements must consist of well-formed character data or markup.
The content of elements must consist of well-formed character data or markup. 错误信息如下: 错误原因: 编写xml时,里面出现了特殊字符 解决方法: 使用xml中的转义字符进行转换 .... <= 30 ORDER BY `pro_time` DESC 使用<![CDATA[ ]]>符号进行说明,将此类符号不进行解析 <![CDATA[ WHERE DATEDIFF(NOW(原创 2020-07-24 22:47:07 · 235 阅读 · 0 评论 -
Mybatis懒加载时,springMVC返回JSON异常 Could not write JSON: No serializer found for class
Mybatis懒加载时,springMVC返回JSON异常 Could not write JSON: No serializer found for class 错误信息如下: 错误信息: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$Enhanced原创 2020-07-24 22:39:51 · 1411 阅读 · 1 评论