Hibernate生成负id

时间:2018-01-15 15:52:34

标签: java hibernate jpa

你好我回来寻求帮助:当我将数据插入我的H2控制台数据库时,我得到负值id并且我的所有字段都有" NULL"值。

 @Entity
 @Table(name = "tcustomer")
 public class Customer implements Serializable{

    private static final long serialVersionUID = 1L;

@Id
@SequenceGenerator(name = "pk_sequence",sequenceName = "sequence_tcustomer", initialValue = 1000, allocationSize = 100)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pk_sequence")
private Long uidpk;

请帮帮我吧

以下是我的H2控制台数据库的图像:
H2 DataBase

0 个答案:

没有答案