用mybatis取值,字段赋值错误的问题

来源:互联网 发布:什么是creis中指数据 编辑:程序博客网 时间:2024/05/22 10:23

 博主 在读取数据库的表信息时,出现了不同字段取值对应不上的情况,有些字段的赋值是错位置的,

 <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">


BaseResultMap 里的字段对应是错误的,估计是Map里字段顺序的问题。改成了

<update id="updateByPrimaryKeySelective" parameterType="com.tour.info.admin.model.Template">


可以正确读取


另外还查知:

还有mybatis ,mapper.xml的各个字段的顺序是不影响赋值的,是自动对应的。