如何使用Hibernate自动递增非主id列?

时间:2013-05-03 03:03:36

标签: hibernate annotations increment

我通过在表格中使用自动增量选项保持主键的自动增量。 我说使用了hibernate。

但是现在我想使用Hibernate Annotation自动增加一个不是主键列的列。 请帮忙。提前谢谢。

1 个答案:

答案 0 :(得分:1)

在特定字段

上使用以下注释

@GeneratedType

private int non_Primary_field