Since you cannot use SEQUENCE , and AUTO just automatically selects a supported generator algorithm from the existing ones, you are left with IDENTITY and TABLE .
TABLE : uses the hi / lo algorithm to efficiently generate identifiers of type long, short or int, given the table and column as the source of the hi values. The hi / lo algorithm generates identifiers that are unique to a specific database only. → Denotes an additional request for the generated object . (This is not true if you use optimizers. Unfortunately, using the optimizer is usually not used by default if the optimizer is not specified.)
IDENTITY : supports identity columns in DB2, MySQL, MS SQL Server, Sybase, and HypersonicSQL. → Performance is a way , like you, without Hibernate. A database has been created, almost no overhead.
There are more Hibernate-specific generators, but they will not beat the database identifier for performance. (See 5.1.2.2.1. Various additional generators in a related document.)
source share