High-Performance Java Persistence – Chapter 10 – Mapping Types and Identifiers

Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?

Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.

So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!

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 Types
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 Identifiers
10.2.1 UUID identifiers The assigned generator 
10.2.2 The legacy UUID generator The newer UUID generator 
10.2.3 Numerical identifiers Identity generator Sequence generator Table generator Optimizers The hi/lo algorithm The default sequence identifier generator The default table identifier generator The pooled optimizer The pooled-lo optimizer Optimizer gain Sequence generator performance gain Table generator performance gain Identifier generator performance 

Chapter summary

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: hi/lo, pooled and pooled-lo.

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.

Transactions and Concurrency Control eBook

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.