hi forum,
i have a question about the right annotaion for using a sequence
as a generator for an id.
@Id
@Column(name = "ID", nullable = false, unique=true)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="HIB_SEQ")
@SequenceGenerator(name="HIB_SEQ",sequenceName="USERS_SEQ")
this is my implementation, the sequences name in db is USER_SEQ
the problem is that hibernate uses a own sequencegenerator and the
returning id for an insert is wrong.
is the usage of @SequenceGenerator the right way for using Oracle Sequences?
thx for any hints!
|