In the application that I currently work on generators (of type sequence) are used to create the IDs for all of our objects, so I somewhat understand how this works.
What I need for a feature I'm adding is a integer value that is incremented during a particular point of execution in the program. I was thinking that a sequence would be perfect for this. Has anyone ever done this before? I can't seem to figure out how to expose (read and set) the sequence value.
Now my problem is creating the Hibernate configuration file. I've created the file but my sequence has no id column, which means that I can't provide an ID element withing my class element. Without the id element an XML parsing exception occurs during initialization.
Anyone have any ideas how to get around this. composite-id can also be supplied but I haven't looked into that yet.
posted 13 years ago
I found the solution. Pretty easy really.
The id is just the column holding the sequence name. This seemed to make things happy. I'm using postgresql by the way.