Hibernate注释,自动增量相关 [英] Hibernate annotations, autoincrement related

查看:94
本文介绍了Hibernate注释,自动增量相关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用hibernate注释,在后端使用Postgres SQL 8.3。所以,我不知道如何在我的Class的批注中应用序列。

i am using hibernate annotations, at the back end i am using Postgres SQL 8.3. So, i don't know how to apply sequence in annotations of my Class.

Plz为此提供相关帮助。

Plz provide related help for this.

推荐答案

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

然后,将它放在序列字段的前面:

Then, put this in front of your sequence field:

@GeneratedValue(strategy=GenerationType.SEQUENCE)



<希望有任何帮助......

hope that was of any help...

这篇关于Hibernate注释,自动增量相关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆