新增产品失败,rowcount=0
来源:8-9 商品管理模块所有功能自测
主打情歌
2018-06-13
返回的结果是更新产品失败。
日志
[15:03:23.204][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-5] Creating a new SqlSession
[15:03:23.205][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-5] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1ad4a03c] was not registered for synchronization because synchronization is not active
[15:03:23.205][DEBUG][o.m.s.t.SpringManagedTransaction][http-nio-8088-exec-5] JDBC Connection [jdbc:mysql://127.0.0.1:3306/mmall_learning?characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[15:03:23.206][DEBUG][c.m.dao.ProductMapper.updateByPrimaryKey][http-nio-8088-exec-5] ==> Preparing: update mmall_product set category_id = ?, name = ?, subtitle = ?, main_image = ?, sub_images = ?, detail = ?, price = ?, stock = ?, status = ?, create_time = ?, update_time = now() where id = ?
[15:03:23.208][DEBUG][c.m.dao.ProductMapper.updateByPrimaryKey][http-nio-8088-exec-5] ==> Parameters: 1(Integer), 三星洗衣机(String), 三星大促销(String), test.jpg(String), test.jpg(String), detailtext(String), 1000(BigDecimal), 100(Integer), 1(Integer), null, 3(Integer)
[15:03:23.209][DEBUG][c.m.dao.ProductMapper.updateByPrimaryKey][http-nio-8088-exec-5] <== Updates: 0
[15:03:23.210][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8088-exec-5] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1ad4a03c]
Product{id=3, categoryId=1, name='三星洗衣机', subtitle='三星大促销', mainImage='test.jpg', subImages='test.jpg', detail='detailtext', price=1000, stock=100, status=1, createTime=null, updateTime=null}
3回答
-
看看你的product的id是不是真的存在吧,可能找不到对应的product
032018-06-17 -
qq_黑男_04384141
2019-05-23
我的是新增失败
00 -
qq_黑男_04384141
2019-05-23
我也是跟你一样的问题,怎么解决呀
00
相似问题