JPA Annotated id field in Hibernate


/ Published in: Java
Save to your folder(s)

Creating a annotated id field using Hibernate and JPA


Copy this code and paste it in your HTML
  1. @Id
  2. @GeneratedValue(generator = "table_name_cid_gen")
  3. @GenericGenerator(name = "table_name_cid_gen", strategy = "sequence", parameters = {
  4. @Parameter(name = "sequence", value = "table_name_cid_seq"),
  5. @Parameter(name = "unsaved-value", value = "0") })
  6. @Column(name = "cid")
  7. private int id;

URL: http://forum.springsource.org/showthread.php?t=45036

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.