spring data jpa报出 a different object with the same identifier value was already associated with the session 异常 不能添加两个有唯一标识的实例对象到数据库 循环插入很多条数据到数据库,开始以为是session问题,后面发现是类上面的主键自增策略没有加上 使用idea自动生成的jpa类不会自己加上主键策略