mybatis @Options(useGeneratedKeys = true, keyProperty = “id“)注意⚠️

这个insert插入语句,方法传递的参数,必须是这个类的一个对象,不能是这个类的一些属性值。不然会报错。:org.apache.ibatis.executor.ExecutorException:+Could+not+determine+which+parameter+to+assign+generated+keys+to.+Note+that+when+there+are+multiple+parameters,+%27keyProperty%27+must+include+the+parameter+name+(e.g.+%27param.id%27).+Specified+key+properties+are+%5Bid%5D+and+available+parameters+are+%5Bcontext,+param3,+param1,+taskTime,+dayTime,+param2%5D++at&tn=84053098_3_dg&ie=utf-8在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_20156289/article/details/112607258