Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

hibernate id oracle sequence

hibernate id oracle sequence  using -'java,oracle,hibernate,orm,jpa'

My database is Oracle, and my id column value is an Oracle sequence, this sequence is executed by a trigger, so, before each row is inserted this trigger use this sequence to get the id value. So I am confused in which id strategy generation should I define in my entity class.

@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")


@GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator")
@SequenceGenerator(name="idGenerator", sequenceName="ID_SEQ")


@GeneratedValue(strategy = GenerationType.AUTO)

Really confused, Could someone shed some light on this subject? Please explain clearly..

asked Sep 15, 2015 by DRHCec
0 votes

Related Hot Questions

Government Jobs Opening