
How to Use the Criteria API for Dynamic JPA Queries
Build dynamic JPA search queries with the Criteria API, the static metamodel and Spring Data Specifications, including paging, joins and the count query trap.
Entity mapping, lazy loading, the N+1 query and other ways JPA surprises you, with the SQL it actually runs.

Build dynamic JPA search queries with the Criteria API, the static metamodel and Spring Data Specifications, including paging, joins and the count query trap.

Use Hibernate StatelessSession to import and export large data sets without a persistence context, with JDBC batching, scrollable queries and the trade-offs.

Implement soft deletes with Hibernate: the @SoftDelete annotation, filtering deleted rows, restoring, unique constraints and when a real delete is better.

What Open Session in View does in Spring Boot, why it hides LazyInitializationException, how it keeps a database connection longer, and how to spot its costs.

Compare Hibernate, Spring JdbcClient and jOOQ for reporting queries with grouping, windows and large result sets, and pick one by the shape of the query.

Stop SQL injection in Java by binding values with parameters in JDBC, JPA and Spring, allow-listing identifiers and limiting what the database account can do.

Why HikariCP reports that a connection is not available, how to tell a leak from a pool that is too small, and how to size the pool for the database.

Run real PostgreSQL or MySQL in Java tests with Testcontainers: dependencies, JUnit extension, JDBC URL, migrations, performance tips and Docker requirements.

See what Hibernate really sends to the database: SQL logging with bind values, statistics, slow query logs, flush timing and detecting N plus 1 problems.

Build a Vaadin CRUD screen on Spring Data JPA: entity, repository, a lazy grid, a binder backed form and delete with confirmation, in one view.

Map your first JPA entity with Entity, Table, Id, GeneratedValue and Column, with the no argument constructor, equals and hashCode rules that Hibernate needs.

Decide what is an entity, a value object and an aggregate in a Java domain model, size aggregates by consistency rules and avoid the common mapping traps.
We send one email when a new post is published. No spam.