The optional <generator> child element is the name of a Java class that is used to generate a unique identifier for the persistent class instance. If this generator instance requires certain configuration values or initialization parameters, you can use the <param> element to pass these parameters.
All generators implement the org.hibernate.id.IdentifierGenerator interface. This is a very simple interface; some applications can choose to provide their own specific implementation. Of course, Hibernate provides a lot of built-in implementations.
Here are some shortcut names for built-in generators:
Increment (increment)
Used to generate unique identifiers for long, short or int types. It can only be used if no other process inserts data into the same table. Do not use it in the cluster.
identity (identity)
Provides support for built-in identification fields for DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short, or int.
sequence
Sequence is used in DB2, PostgreSQL, Oracle, SAP DB, McKoi, and generator is used in Interbase. The returned identifier is of type long, short, or int.
assigned (self-assigned)
The primary key is generated by an external program, and Hibernate does not require the participation of the application to assign an identifier to the object before the save() method is called. This is the default generation policy when the <generator> element is not specified.
The above article is the generator configuration method for Hibernate mapping file id. I hope it can give you a reference and I hope you can support Wulin.com more.