finds.dev← search

// the find

AnghelLeonard/Hibernate-SpringBoot

★ 1,372 · Java · Apache-2.0 · updated Mar 2026

Collection of 300+ best practices for Java persistence performance in Spring Boot applications

A giant reference collection of 300+ runnable Spring Boot + Hibernate examples, each demonstrating one specific JPA/SQL performance pattern — batch inserts, DTO projections, N+1 detection, connection pool tuning, etc. It's aimed at Java developers who already know Spring Data but keep hitting the same ORM performance traps. Think of it as a searchable cookbook, not a framework.

Each example is a self-contained Maven project you can clone and run against a real database — not pseudocode. The coverage of batching nuances is unusually thorough: it distinguishes saveAll() vs EntityManager vs Session-level batching, explains why IDENTITY generators break batching on both MySQL and PostgreSQL, and shows the hi/lo sequence workaround for Postgres. The DTO section covers every realistic retrieval path (projections, Tuple, constructor expressions, SqlResultSetMapping) with working queries rather than hand-waving. The SQL statement counting pattern via DataSource-Proxy + db-util is a genuinely useful testing technique that most teams don't know exists.

The repo targets Hibernate 5/6 and Spring Boot 2, which are both past their support window — the author has split off a separate repo for Boot 4/Hibernate 7 rather than updating this one, so anything you learn here may need translation. The structure is 300+ sibling directories with no cross-linking index or search beyond the long README scroll, making it hard to find the example you need without grepping. Examples are all against a 'bookstore' toy schema with no realistic data volumes, so performance claims can't be validated from the code alone. There's no test suite — the examples are manual run-and-observe, which means a broken example could sit undetected for months.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →