High-Performance Java Persistence – Chapter 12 – Inheritance

Part 2, Chapter 12

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 JPA inheritance from a data access performance point of view.

12. Inheritance
12.1 Single table 
12.2 Join table 
12.3 Table-per-class 
12.4 Mapped superclass 

Continue reading “High-Performance Java Persistence – Chapter 12 – Inheritance”

Advertisements

How do JPA and Hibernate define the AUTO flush mode

Introduction

The Persistence Context acts as a transactional-write behind cache for the incoming entity state transitions, and all changes are synchronized with the database during flushing.

Although both the Hibernate Session and the JPA EntityManager define a flush() method to manually trigger this process, it’s much more convenient to let Hibernate manage the Persistence Context flushing. Unfortunately, there’s is a major difference between how JPA and Hibernate define the automatic flushing mechanism.

Continue reading “How do JPA and Hibernate define the AUTO flush mode”

High-Performance Java Persistence – Chapter 11 – Relationships

Part 2, Chapter 11

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 JPA relationships from a data access performance point of view.

11. Relationships
11.1 Relationship types     
11.2 @ManyToOne       
11.3 @OneToMany       
11.3.1 Bidirectional @OneToMany   
11.3.2 Unidirectional @OneToMany  
11.3.3 Ordered unidirectional @OneToMany
11.3.3.1 @ElementCollection    
11.4 @OneToOne      
11.4.1 Unidirectional @OneToOne   
11.4.2 Bidirectional @OneToOne  
11.5 @ManyToMany      
11.5.1 Unidirectional @ManyToMany 
11.5.2 Bidirectional @ManyToMany  
11.5.3 The @OneToMany alternative

Continue reading “High-Performance Java Persistence – Chapter 11 – Relationships”