发表于: 2018-01-26 23:19:20
1 562
今天完成的事情:
1. 完成接口:
资讯列表,意见反馈,资讯上下架
明天计划的事情
1. 小课堂
2. 意见列表,删除,查看
遇到的问题:
1.传入的List<Long> 实际上为List<Integer>类型
导致删除接口报错:
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type for class com.ptteng.playlearn.ojbk.course.model.Step. Expected: class java.lang.Long, got class java.lang.Integer; nested exception is org.hibernate.TypeMismatchException:
Provided id of the wrong type for class com.ptteng.playlearn.ojbk.course.model.Step. Expected: class java.lang.Long, got class java.lang.Integer
通过id批量删除的时候入参类型为Integer,不能执行,所以报错,
但是,由于在本地的memecache开启,框架执行删除前先去执行查询语句,把id作为字符存入缓存,而后查询,当删除的时候,取出来,id映射为Long类型 , memcache 屏蔽了Integer和Long,但是服务器上没有开启memecache ,导致不能进行转化, 查看操作失败 ,从而不能删除,所以报错。
但是这个错误被service所捕获,没有展现到web层,而web 提示删除成功,实际却没有成功
收获:
spring 3的映射处理已经遇到了两个坑了。。。
意见后台相关
预计完成时间:2018.01.27
DOME时间:2018-2-9
评论