Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generating PK

 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB 3 in Acion , page 268

I am not sure where we keep (in which entity/class) the following code

- @SequenceGenerator (name="U_seq_Gen", sequenceName = "U_Seq", initialValue=1, allocationSize=10)
- @TableGenerator (name="User_t_gen", tableName="SeqG_T", pkColumnName="SEQ_Name", valueColName="SEQ_Val", pkColumnValue="U_SEQ")

plseae suggest...

thanks...

 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can keep it as an entity annotation, or directly on an id field / property. It is scoped to a whole persistence-unit anyways.
 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic