mybatis
-
MyBatis查询单条后显示null的问题解决方法
在使用Mybatis做单条查询的时候,遇到查询出来本来有数据,可是打印出来的时候却是null,或者直接报【java.lang.NullPointerException】错误,效果如下: ==> Preparing: select * from product_category where category_id=? ==> Parameters: 1(Integer) <== Total: 1 null 可以看出分明返回Total:1,查询出一条数据了,可...
阅读更多左鹏03-06 13:18:16
-
MyBatis:update动态sql的使用
配置xml文件,使用set if 标签 <update id="save" parameterType="ProductCategory"> update product_category <!-- set会自动去掉最后一个, --> <set> <if test="categoryName!=null and categoryName!=''">category_name=#{c...
阅读更多左鹏03-06 12:33:57
-
MyBatis报错:Could not set parameters for mapping: ParameterMapping{property='categoryName', mode=IN, j
刚开始学习mybatis在update时一直报以下错误 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='categoryName', mode=IN, javaType=class java.la...
阅读更多左鹏03-06 12:26:36
点击排行

猜你喜欢
站点信息
- 建站时间:2018-09-18
- 网站程序:Spring Boot
- 主题模板:《今夕何夕》
- 文章统计:104条
- 微信公众号:扫描二维码,关注我们
