This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Generating PK  RSS feed

 
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
Boost this thread!