I am trying to learn how Hibernate works, and I am running into an almost unacceptable learning curve. I can\'t see how to get Hibernate to respect the auto_increment policy
I wrote this in a comment under the accepted answer, but those aren't shown by default so I'll re-post it as an answer.
I was using a hibernate.cfg.xml file off some dude's web site, and it had this:
create
This made the system to re-create my table each time I ran my app. Commenting it out solved the problem.
The other two answers about the various ways to create IDs are correct. My original problem's symptom seemed to do with ID generation, but the actual cause was misconfiguration.