The hibernate generator classes implements hibernate.id. IdentifierGenerator interface, and over ride the generate method to generate the identifier or primary key value.
< generator > is one of main element in the mapping file of hibernate framework. The
While saving an object into the database, the generator informs to the hibernate that, how the primary key value for the new record is going to generate.
Hibernate use different primary key generator algorithms, for each algorithm internally a class is created by hibernate for its implementation. There are many generator classes defined in the Hibernate Framework.
If we want our own user defined generator, then we should implement IdentiferGenerator interface and override the generate().
All the generator classes implements the org.hibernate.id.IdentifierGenerator . Hibernate framework provides many built-in generator classes: