Hi,
I am not sure what I am doing wrong but I have been struggling to generate sequence for the last two days.
Please tell me how to do sequence generation with the hibernate annotation. I wan "accountNumber" field to be incremented.
Code:
@SequenceGenerator(name = "generator", initialValue = 1001)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "generator")
private int accountNumber;
Eventhough it is kind of different the following works. if I do samething with the about field(accountNumber with string type) it doesn't work
Code:
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@DocumentId
private String id;
Note: I am using hibernate 3.4.0.GA and Mysql 5.1
Please tell me what I am doing wrong...
Thanks