Use sequences on Hibernate entities


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



Copy this code and paste it in your HTML
  1. @Id
  2. @Column(name = "OFFER_ID")
  3. @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "OFR_OFFERS_SEQ")
  4. @SequenceGenerator(name = "OFR_OFFERS_SEQ", sequenceName = "OFR_OFFERS_SEQ", allocationSize = 1)
  5. private Long offerId;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.