The Generator class is used to generate ids for the persistent class objects. These unique ids are inserted into the mapped table as primary key values. All the generator classes implement the org.hibernate.id.IdentifierGenerator interface. The default generator classes provided by the Hibernate Framework are as below:  Assigned: is supported by all databases and is the default generator class  Increment: is supported by all databases and uses the formula of max id value of database + 1  Sequence: is not supported in MySQL. It reads next value of a database sequence and then returns that value as id to the hibernate. If there is no sequence in the database, it uses the default sequence  Hilo: is used to generate ids of types short, int and long. It uses the low and high algorithm. Hilo is a shortcut name for the TableHiloGenerator class.   Native: It uses the identity, sequence or hilo generator classes to generate ids depending on the type of database.  Identity: it is used in databases like Sybase, MS SQL etc to support the id column. The id that is returned is of type short, int or long. The database has the responsibility of generating the unique identifier.    uuid: UUID stands for Universal Unique Identifier and is a shortcut name for AbstractUUIDGenerator class. This generates a string of 32 characters based on the starting time of the JVM, IP address of the machine, Counter value of the JVM and the system time.   foreign: This generator class is used in only one – to – one relationship. It returns the id of the parent as the id of the child.  Of the above classes, assigned, increment, sequence, hilo, native, foreign and identity are used for int, long and short types of primary keys, whereas uuid is used for string type of primary keys (varchar2).