hibernate - Hibernate new_generator_mappings 到底做了什么?

标签 hibernate jpa spring-boot

Spring Boot/JPA/Hibernate 新手,我试图了解 hibernate.id.new_generator_mappings 的含义。属性实际上确实如此。

根据该文档,它:

"...directs how identity or sequence columns are generated when using @GeneratedValue"

但它并没有真正解释 truefalse 时的行为差异。有什么想法吗?

最佳答案

This ‘hibernate.id.new_generator_mappings’ by default is false which uses the ‘SequenceHiLoGenerator‘ which will have that multiply behavior. Once we set it to true, it will then use the ‘SequenceStyleGenerator‘, which is more jpa and oracle friendly. It generates identifier values based on an sequence-style database structure. Variations range from actually using a sequence to using a table to mimic a sequence.

来源: https://vcfvct.wordpress.com/2016/04/23/jpa-sequencegenerator-with-allocationsize-1-performance-tuning/

关于hibernate - Hibernate new_generator_mappings 到底做了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43264106/

相关文章:

java - JPA 中的 FetchMode 作为 JOIN

java - 行大小太大 (> 8126) hibernate

java - Spring反序列化带有额外列的manytomany表

java - "object references an unsaved transient instance"双向一对一

java - hibernate : Sorting ManyToMany mapping

angularjs - 一个项目中的 Spring Rest 和 Angular JS

java - 用于 Spring Boot 应用程序的 Logback 自定义数据库附加程序

mysql - 告诉 Hibernate 的 hbm2ddl 为 @Enumerated 注释字段添加 MySQL 枚举列

java - EntityManager 嵌套事务原子性

spring-boot - 使用 Spring Webflux 时在后台运行 Mono,同时返回响应