The Marco Show

Hibernate: Myths & Over-Engineering. ORMs vs SQL vs Hexagonal — Gavin King

The Marco Show

Show Notes

📺 Note: This episode contains screensharing and live coding examples that work best visually. If you’d like to follow along, check out the full video version on YouTube: https://youtu.be/Qvh3VFlvJnE. Gavin King (creator of Hibernate) joins Marco to cut through the myths of Java persistence. When should you skip layers of repositories and just write SQL, or even model database views? What actually causes lazy-loading pain, and how do stateless sessions help? We cover Hibernate, JPA, and where Jakarta Data is headed, plus pragmatic advice for legacy schemas, performance, and keeping your code DRY.

💡 Topics in this episode: • SQL vs repositories (and why views can be your adapter layer) • The three inheritance strategies, and the trap of table-per-class • Stateless sessions vs stateful persistence contexts • LazyInitializationException explained (and avoided) • DRY first: let architecture emerge via refactoring • Jakarta Data 1.0/1.1: annotation processing, stateful repos, dynamic queries • Performance rule-of-thumb: minimize round-trips

⏱️ Timestamps (00:00) Teaser (01:00) Gavin King intro and early Hibernate motivation (03:59) Old-school open-source culture and discovery (08:39) SQL isn’t hard: minimize DB round-trips (10:03) “Leaky abstractions are good” (and why) (12:04) Architecture should emerge from code (15:44) DRY as commandment #1 (22:05) Reviewing a typical Spring Data setup (and pitfalls) (25:39) Inheritance strategies: joined vs single table vs table-per-class (30:06) One screen? Just write a SQL query (pragmatism) (33:08) When ORM shines: operations over graphs (35:22) Use views to adapt messy legacy schemas (43:18) Jakarta Data repos: annotation-driven, step-into-able (44:59) Stateless Session: less magic, explicit updates (48:51) Jakarta Data 1.1: stateful repos, dynamic queries, reactive (01:24:22) Rapid fire questions (01:33:15) Features Gavin would delete and lessons learned (01:42:30) Giveaway

New episodes every other Wednesday. Subscribe for deep, developer-focused conversations.

More from The Marco Show

Sep 2, 2026

Michael Simons, a longtime Java developer and Neo4j engineer, joins Marco to talk about the engineering principles that have stayed relevant across decades of changing technologies. The conversation covers database-first thinking, Spring and the Java ecosystem, graph databases, developer tooling, and why pragmatic decisions often matter more than chasing the “best” framework. They also discuss how AI is changing software development, where AI tools genuinely help, and why human judgment and responsibility still matter. 💡 In this episode: Why Michael still starts with the data model when building applications

Aug 19, 2026

Venkat Subramaniam joins Marco to talk about what AI is really changing for developers. They discuss why AI often impresses novices more than experts, why “AI first” is the wrong mindset, and why critical thinking, fundamentals, and judgment matter more than ever. 💡 In this episode: Why AI is better at finding problems than writing code

Aug 5, 2026

Sébastien Deleuze, a longtime Spring Framework committer and member of the Spring AI team, joins Marco to talk about how 13 years on the Spring team shaped his pragmatic approach to software development. The conversation covers how Spring AI fits into the Spring ecosystem, why enterprise AI still needs deterministic workflows and human accountability, and why long-term software quality matters even as GenAI changes how code gets written. 💡 In this episode: How Sébastien joined the Spring team through open source contributions

Jul 22, 2026

Josh Long, Spring Developer Advocate at Broadcom, joins Marco to cover 25 years of Spring history and what the JVM's real shot at the AI era actually looks like. Josh has published a weekly blog since 2011 and a weekly podcast since 2018 without missing an episode. This conversation gets into why vibe coding concerns him as an engineer, what accountability for AI-generated code actually means, and why Python's dominance in AI is more a marketing gap than a technical one. 💡 In this episode: Spring's origin story: why the documentation came before the code

Jul 8, 2026

Martin Lippert, longtime maintainer of Spring Tools and one of the people who has witnessed developer tooling evolve from Eclipse to VS Code, joins Marco to discuss how AI is transforming Java development, and what that means for the future of software engineering. ⏱️ Timestamps: (00:00) Teaser(00:38) Meet Martin Lippert, Spring Tools & the evolution of Java IDEs(03:28) What happened to Eclipse? Lessons from the rise and fall of a Java giant(12:20) Why Spring Tools moved to VS Code and embraced the Language Server Protocol(20:03) How AI is changing Java development and everyday coding workflows(21:59) Martin's AI workflow: Cursor, IDEs, code review & testing(26:16) Building developer tools for AI agents instead of humans(31:10) Why AI is changing release cycles and developer tooling(36:03) AI review fatigue, cognitive depth & trusting generated code(39:06) Will AI replace senior developers? What happens to junior engineers?(42:16) The future of Java, Spring & software architecture in an AI-first world(48:42) AI's hidden energy problem and the sustainability challenge(54:39) Practical tips for greener software engineering and AI usage(1:00:06) Giveaway & rapid-fire questions

See all episodes →