Originally posted by Gregg Bolinger:
The Hibernate example is not generating a new Unique ID like it is supposed to be doing.
Actually, since you are using the identity generator, it is really up to MySQL to generate the unique id. Hibernate is just going to retrieves its value. Therefore, the next question is: Did you set up LogonID as an identity field in your database schema?
For
testing purposes you could also use the hilo generator.
For this to work you will need an additional table in your schema named User_Identity with a single column named next. Unfortunately, you can't use hilo when supplying your own Connection to Hibernate, or when Hibernate is using an application server datasource to obtain connections enlisted with JTA. Therefore it is best when used in testing/prototyping, in a real production application your best bet is to delegate the id generation to the underlying database with either an identity field or sequence depending on what your database supports.