mybatis之增加操作

1、切记切记 在impl类中一定要机上 session.commit() 否则他不会提交

若没有写session.commit();则更新的数据没有进行更新

进行add和update必须进行session.commit();

https://blog.csdn.net/jethai/article/details/52345220

2、就是内个id总是报null  那原因是为什么呢?

我的原因就是因为 没有session.commit()

第二次是因为数据库字段设置 没有将id设置为自动增长所以就出现null了

猜你喜欢

转载自www.cnblogs.com/9797ch/p/12154106.html