OK, I was making no sense at all.
I do have a table called SEQUENCES and the table generator is this:
Code:
@TableGenerator(name = "operationGenerator", table = "SEQUENCES",
pkColumnName = "SEQ_NAME", pkColumnValue = "OPERATION",
valueColumnName = "SEQ_NUMBER")
There is currently just one record in that table:
Code:
|ID|SEQ_NAME |SEQ_NUMBER|
|2 |OPERATION|18392 |
I said "INSERT", but what I meant was "UPDATE", because I thought Hibernate would actually update the record in the table SEQUENCES... But I don't see that happening.
The record is untouched, no matter how many "Operations" I create and persist. And the weird thing is that it is taking the value for the ID only god knows where... I have rows in the table OPERATION starting from ID 919600...
What does Hibernate do? Does it cache the number, increment it in memory and then use it?
How does it maintain uniqueness among all the servers?
Where does it even get the values from? Do I need to specify the initialValue, and why?
I'm lost here...