Spring Data JDBC Tutorial: How to simplify data access in Spring Boot

preview_player
Показать описание
I'm really excited to bring you this Spring Data JDBC tutorial. In this lesson, you can follow by creating your own Spring Boot application from scratch and accessing a database with Spring Data JDBC. You will learn how to create relationships with domain objects and across aggregates. Speaking of aggregates we will take a brief stop to discuss aggregates and aggregate roots from Domain Driven Design.

🔗Resources & Links mentioned in this video:

👋🏻Connect with me:

Рекомендации по теме
Комментарии
Автор

"I've been blogging for 20 years and I've never got comments" ... Savage!

Also, subbed! Thank you, Dan!

eniever
Автор

finally someone smart talking about tracking entity changes! thank you so much Dan!

maxjustmax
Автор

Thanks for clearing my confusion about Aggregates and how they are related.

hudamisatv
Автор

I found this channel today and I had to subscribe. Great content 👏

gequation
Автор

As an Android dev, I am used to build databases with sqlite without any annotations. This is working for me since years in real world apps. So diving in the Hibernate stuff, it feels like a pain in the ass to do even simple inserts.
I will give JDBC a try! Thanks for your tutorial!

LaMartini
Автор

I never used Spring data JDBC before but this video opens a new perspective for me about having more understandement and <control> about relationships. Thank you Dan ! This makes wanna dive more and how to do a few things with spring data JDBC :
1. Pagination of the Comments within a Post when reading a Post, assuming we had to add it as feature
2. Filtering and sorting of Comments with a given post
3. Transactions between Post and Author

jaysizmir
Автор

Awesome presentation! I have used Spring Data JDBC in one of my side projects. Initially it took some time to understand, but it simplifies many things as compared to JPA. Thanks.

omkar.at.office
Автор

Awesome tutorial, I liked the in aggregate solution i.e between Post and Comment. I am curious on how you would go about to solve to oddities below
1. Pagination of the Comments within a Post when reading a Post, assuming we had to add it as feature
2. Filtering and sorting of Comments with a given post
3. Transactions between Post and Author

geofreyssekirime
Автор

Nice walkthrough! I'm not sure (Post, Comment) is a good aggregate. It may work for a tiny blog where posts usually have 10 comments, but as soon as you go in the hundreds & thousands of comments, with comment threads, this stops being a viable design. Treating it as a consistency boundary in that case is crazy.

NullPointerDeception
Автор

Over the years being in different teams and working with different people, i have come to the conclusion that JPA and Hibernate is poorly understood by the majority of people and usually it makes more harm than help. I personally always use Spring JDBC and write plan SQL queries for everything along with RowMappers. Having a strong grasp of SQL helps me have full control over everything and i don't have to care about some strange behavior of JPA and Hibernate.
Anyway if the people at the team understand it properly, than i see no issues with using it.

AleksandarT
Автор

Great tutorial, it was really helpful. One thing that left me a bit disappointed is you mentioned the "version" column in the Post entity, which is something specific to Spring Data JDBC but did not really explain it. Do you know where I can read more about this concept? Cheers

Analogrebelable
Автор

great tutorial. could you please show how to solve this using JPA and entity mapping? thanks

bamideletewogbade
Автор

😁I will read ur blogs and leave comments since today.

nikochen
Автор

@Dan Vega Please do one on Spring Data JPA

amitdubey
Автор

Assume there have many comments, if the JDBC will delete all comments before add new one to make sure consistent but result in lower performance?

leishi
Автор

Hi Dan! I want to know how to implement pagination + inner conditions like (condition OR condition) AND (condition OR condition) in spring data jdbc. Please help
out on this

hareeshkumar
Автор

Around 33:19 you are querying rows from comment table. There's no primary key. How can we have multiple comments on the same Post-row?

theNikki
Автор

I'm puzzled

Entitys identity should be based on primary key, and on primary key only (otherwise it is a value object)
However, you are using record as Author entity without overriding equals (and hashCode). How can this even work?

theNikki
Автор

So if I want to see only list of posts without comments on /posts, I need to look at them as separate aggregates, right? And in single post view I would load that comments (/posts/1).

desdichago
Автор

What's the use of author repository?

CATO_YT