盒子
盒子

后台开发问题集锦

  • SpringBoot:a different object with the same identifier value was already associated with the session
  • 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    @Entity
    @Table(name = "seat")
    public class Seat {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    @NotNull
    // 座位所在楼层
    private int floor;
    @NotNull
    // 座位编号
    private int number;
    @NotNull
    // 座位状态,0表示空闲,1表示占用
    private int idle;

    只需将@GeneratedValue(strategy = GenerationType.AUTO)去掉

    支持一下
    扫一扫,支持Grooter
    • 微信扫一扫
    • 支付宝扫一扫