开发者

When to use @TableGenerator?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜