views:

10

answers:

1

Can you tell me when to use it and why should I create a new table just for keeping primary key while most DBMS now support auto increment and you can adjust it easily?

+1  A: 

The major advantage of the TableGenerator is portability, this is the only strategy that is guaranteed to work with any database. Another advantage is that table sequencing is fully transactional and permits truly sequential ids to be allocated (at the cost of performance and concurrency), if desired.

See also

Pascal Thivent