• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iterating a Primary key in using Generators in Hibernate

 
Ramki Sukumaran
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody tell me how to initialize the value for a primary key of a Table when we are inserting a row in a table via Hibernate. That is we are using any of the following generator strategy to generate the primary key for a table.

1. AUTO
2. SEQUENCE
3. TABLE
4. IDENTITY

Say for example: My records primary key should start from 1001 value and should iterate when we add the records after that.

EmpId Fname Lname
1001 John Peter
1002 Jerald Rosario

My records should be like the above and should iterate on....

Regards
Ramki S
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic