Migrating from (Spring Data) JPA to Spring Data JDBC by Jens Schauder @ Spring I/O 2024

preview_player
Показать описание
Spring I/O 2024 - 30-31 May, Barcelona

A long long time ago in a city far away Jens Schauder started coding on a desktop calculator programmable in assembly. Over 30 years later, after almost 20 years as a consultant working mostly with huge enterprises, he joined the Spring Data Team. Here he works mainly on the “JPA” and “JDBC” modules and tells about it at conferences or helps other developers on StackOverflow. In his spare time he spends time running, bouldering, playing games, torturing himself with Freeletics. And eventually he will write a book about Spring Data JDBC.
Рекомендации по теме
Комментарии
Автор

I can understand why some people would be wandering off to another session just by reading the title and indeed: "why would anyone spend their time migrating from JPA to JDBC?". It contradicts the whole idea of having created JPA in the first place! But I think Jens explain well why this could be a possibility. Great work!

jesprotech
Автор

I migrated a medium sized project to spring data jdbc and was impressed by how straightforward it was. Sure there were some things that had to be changed, ran into a few footguns along the way, but in the end it simplified the code and opened my eyes to all of the "magic" that was happening behind the scenes in the JPA implementation.

AgroTuna
Автор

Based on my experience - for simple pet-projects, or greenfield microservice-style that would work perfectly. For the long-developed humongous monoliths, it's just impossible to introduce. It's not just a code/persistence layer change, but also a mental switch from anemic model to richer model (in DDD style) plus teaching a lot of people what aggregates, bounded contexts or ACLs are.

And I know that the author admits that it's a lot of work, but in general - for big monoliths, it would be time better spend introducing strangler pattern, and just eventually migrating to microservices.

michachlebikpiotrowski
Автор

I have just watched the video but I don't agree with his mapping between Shipment and Item domain model. I don't know you can achieve One--to-Many entity relationship between Shipment and Item, such that a shipment can have many items, with that mapping.

walterkivindu
Автор

JDBC have no support for composite keys or embeddables... so how is JPA to JDBC migration going to work?

macctosh
Автор

Spring Data JDBC has a lot of limitations, which are not explicitly documented, e.g. no derived delete clauses. But the most excruciating part is deleting and inserting child entities on updates, since SD JDBC is unable to track what changed and what did not. This all seemed fine when the project just started, but what I see through these years is that the development speed has slowed down and there aren't many improvements lately.

Mihey
Автор

Keep your @java annotations away from MY domain model please and please don't infect my domain model with persistence concerns.

Mig
Автор

I haven't watched the video yet, but my first question is.... why would I migrate from JPA to JDBC?

pierrelaurensflorez
Автор

I am not going to migrate to Spring JDBC, even in new projects I am using JPA ;)

NeerajKumar-ejyo