Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 1.73 KB

File metadata and controls

20 lines (15 loc) · 1.73 KB

How To Declare Immutable Entities And Store Them In Second Level Cache (e.g., EhCache)

Description: This application is a sample of declaring an immutable entity. Moreover, the immutable entity will be stored in Second Level Cache via EhCache implementation.

Key points of declaring an immutable entity:

  • annotate the entity with @Immutable (org.hibernate.annotations.Immutable)
  • avoid any kind of associations
  • set hibernate.cache.use_reference_entries configuration to true

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.