A different object with the same identifier value was already associated with the session的解决办法

批量保存实体方法报错是因为要保存的实体表内主键自增

需要在实体@Id注解下添加@GeneratedValue(strategy=GenerationType.IDENTITY)注解即可

posted @ 2020-06-09 10:57  卷心菜的奇妙历险  阅读(242)  评论(0编辑  收藏  举报