使用hibernate注解给字段绑定序列报错

使用hibernate注解 给字段绑定序列报错

@Entity
@Table(name = "nfvo_alarm_subscription",uniqueConstraints={@UniqueConstraint(columnNames=("id"))})

@SequenceGenerator(name="ID_SEQ",sequenceName="nfvo_alarm_subscription_id_seq",allocationSize=1)


@Id
@Column(name = "id", unique = true, nullable = false)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator = "ID_SEQ")
public int getId() {
return this.id;
}

绑定序列的字段类型不能是integer 得是int

猜你喜欢

转载自blog.csdn.net/qq_35811626/article/details/80510678