开发者

When to use @TableGenerator?

开发者 https://www.devze.com 2023-01-20 22:16 出处:网络
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?The major advanta

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?


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

  • JPA wiki book
    • Advanced Sequencing
0

精彩评论

暂无评论...
验证码 换一张
取 消