mybatis之增加操作

时间:2020-01-05 23:22:37   收藏:0   阅读:88

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了

原文:https://www.cnblogs.com/9797ch/p/12154106.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!