javax.persistence.GenerationType.IDENTITY
The IDENTITY option simply allows the database to generate a unique primary key for your application. No sequence or table is used to maintain the primary key information, but instead, the database will just pick an appropriate, unique number for Hibernate to assign to the primary key of the entity. With MySQL, the first lowest numbered primary key available in the table in question is chosen, although this behavior may differ from database to database.
I've used @Identity and the @TableGenerator annotations withy MySQL quite successfully. Their use is documented at the end of this tutorial:
Primary Key Generation Strategies with Hibernate JPA and MySQL Database Here's a Hibernate Exmample for the @TableGenerator annoation: