Part 2, Chapter 10
Every new chapter of my book is released right after it’s being completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new material.
Table of content
This chapter explains the core mapping elements used by Hibernate and details the basic type and the identifier generators.
10. Mapping Types and Identifiers
10.1.1 Primitive types
10.1.2 String types
10.1.3 Date and Time types
10.1.4 Numeric types
10.1.5 Binary types
10.1.6 UUID types
10.1.7 Other types
10.1.8 Custom types
10.2.1 UUID identifiers
10.2.1.1 The assigned generator
10.2.2 The legacy UUID generator
10.2.2.1 The newer UUID generator
10.2.3 Numerical identifiers
10.2.3.1 Identity generator
10.2.3.2 Sequence generator
10.2.3.3 Table generator
10.2.3.4.1 The hi/lo algorithm
10.2.3.4.2 The default sequence identifier generator
10.2.3.4.3 The default table identifier generator
10.2.3.4.4 The pooled optimizer
10.2.3.4.5 The pooled-lo optimizer
10.2.3.5 Optimizer gain
10.2.3.5.1 Sequence generator performance gain
10.2.3.5.2 Table generator performance gain
10.2.3.6 Identifier generator performance
The chapter explains the relationship between the three mapping elements used by JPA: basic types, embeddables, and entities.
Because database systems come with specific data types that are targeted towards high-performance, this chapter covers basic types and explains how you can map database-specific types to Hibernate entities.
The second part of this chapter is dedicated to entity identifiers. It covers
UUID and numerical identifiers and it goes through identity, sequence and table generator strategies.
It explains how the enhanced generators differ from the legacy ones, and it covers all major sequence identifier optimizes:
In the end, it shows which identifier generator is suitable for high-performance write-intensive applications, and why you should use the enhanced optimizers developed by Hibernate.