Hibernate

High-Performance Hibernate Tutorial

I’ve been using Hibernate for almost a decade and I admit it was not an easy journey. This tutorial is actually a summary of my book, whose main goal is to provide guidelines and practical advice for optimizing the data access layer performance while maintaining a strong consistency transactional model.

This material is useful for both beginners and experienced developers, going beyond the reference documentation.

Tips and best practices

Bootstrapping

Mappings

Basic types

JSON

ARRAY

Equals and hashCode

Relationships

Advanced mapping techniques

Identifiers

Inheritance

Connection management

Flushing

Fetching

Concurrency control

Batching

Queries

Criteria Queries

Stored procedures

Caching

Audit

Testing

If you like these articles, I bet you are going to love my book as well.

Testimonials

Subscribe to our Newsletter

* indicates required
10 000 readers have found this blog worth following!

If you subscribe to my newsletter, you'll get:
  • A free sample of my Video Course about running Integration tests at warp-speed using Docker and tmpfs
  • 3 chapters from my book, High-Performance Java Persistence, 
  • a 10% discount coupon for my book. 
Get the most out of your persistence layer!

8 thoughts on “Hibernate

  1. Hi Vlad,

    First thanks for your wonderful tutorials. I have learned a lot from it.
    A request is that you should upload tutorials for Hibernate search. It would be a great help.

    Thanks

    1. I will as soon as I have time for that. For the moment, I’m working on my video course and that will keep me busy for quite some time.

  2. When it comes to mappings, I always prefer simplicity. While you can model very exotic relations, those are very difficult to tune and they usually perform badly. For inheritance, I like to push the composition as much as possible. That’s why I don’t go for complex inheritance hierarchies, but rather have a common base entity which can easily swap in simpler many-to-one inheritance hierarchies. This resembles the JOINED inheritance, only it allows you to change from one type to the other without the base class primary key reusing hassle.

Leave a Reply

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