注册时不断报这个错误,这个setbyid是我自定义的插入方法,
仔细查看,发现sql语句错了
<select id="setByid" resultType="integer">
insert into shirouser(id,create_time,updatatime,salt,password)
values(id=#{id},create_time=#{create_time},
updatatime=#{updatatime},salt=#{updatatime},password=#{password})
</select>
这里的 values后面的值应该直接是values( #{},#{}…) ,而不是 xx=#{xx} ,记录一下这个低级
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘create_time’ in ‘class com.example.demo.pojo.shirouser’
还有这个报错,原因是我的xml文件中,插入语句的
#{create_time} 这个名字是数据库中的字段名,而我实体类中的的字段名是createtima ,又一个低级错误
2021/6/1