Python 官方文档:入门教程 => 点击学习
目录使用mybatis取值,字段赋值错误mybatis映射赋值失败错误输出错误造成原因解决方法使用mybatis取值,字段赋值错误 我在读取数据库的表信息时,出现了不同字
我在读取数据库的表信息时,出现了不同字段取值对应不上的情况,有些字段的赋值是错位置的,
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
BaseResultMap 里的字段对应是错误的,估计是Map里字段顺序的问题。改成了
<update id="updateByPrimaryKeySelective" parameterType="com.tour.info.admin.model.Template">
可以正确读取
另外还查知:
还有mybatis ,mapper.xml的各个字段的顺序是不影响赋值的,是自动对应的。
异常:TypeException: Could not set parameters for mapping
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘pmNo’, mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapid=‘null’, jdbcTypeName=‘null’, expression=‘null’}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
在mybatis中SQL添加了注释
将SQL中注释删除即可
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。
--结束END--
本文标题: 解决使用mybatis取值,字段赋值错误的问题
本文链接: https://www.lsjlt.com/news/163098.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0