@Entity public class ConnectPeople { @Id(autoincrement=true) private Long id; private String name; private String mobile; public ConnectPeople(String name, String mobile) { this.name = name; this.mobile = mobile; } @Generated(hash = 910981689) public ConnectPeople(Long id, String name, String mobile) { this.id = id; this.name = name; this.mobile = mobile; } @Generated(hash = 1759600975) public ConnectPeople() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } }
把id改为Long类型,构造方法传参数的时候可以不传Long类型的参数就可以了。