One Migration Equals Two Fires: From JPA to JDBC and Back
summary
A practical comparison of switching between JPA and JDBC in Spring applications: the talk explains that JPA treats the domain as primary and the DB as storage while JDBC treats the DB as primary and returns objects, and shows how that design difference affects migration. It covers concrete issues such as how the data model changes, whether repositories must be rewritten, resolving N+1 query problems, dealing without the JPA first-level cache, and indicators for when to move from JPA to JDBC or vice versa, illustrated with code examples.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:27Migrating from JPA
- 3:14Common migration reasons
- 5:22Framework ideology
- 7:54Ideal migration
- 11:05DDD in Spring Data JDBC
- 15:39Entity changes
- 18:08Query generation
- 22:05Manual query optimization
- 23:51ID generation strategies
- 26:04Updating entities
- 28:58Nested entities in aggregates
- 31:33Transaction context
- 33:39Business logic issues
- 36:12Repository limitations
- 39:01Native queries
- 40:25When to avoid migration
- 43:14Returning to JPA
- 45:40Alternative frameworks
- 47:07Q&A
