
Jakarta Data Repositories and Dynamic Queries

Hibernate Creator: Why Developers Hate ORM (And How We're Fixing It) - Gavin King
Topic 9 of 11
Published Sep 22, 2025 · Clip 1:08:53–1:16:03 (7:10)
Gavin pitches Jakarta Data: its primary advantage is immediate compile-time feedback on query correctness via annotation processors in the IDE. Repositories also provide a flexible place to organize queries, and he challenges the one-repository-per-entity convention, suggesting repository-per-controller might have higher cohesion. He then discusses dynamic query construction: the old Hibernate criteria API was janky, the JPA 2 criteria API became monstrous though it has improved with var and better annotation processing, and Jakarta Data 1.1 will introduce an elegant middle-ground API for programmatically adding restrictions — filling the gap between static JPQL and fully dynamic criteria.