Spring Boot Webflux CRUD Tutorial - Using Spring Data R2DBC & PostgreSQL

preview_player
Показать описание
We create a fully functional spring boot webflux CRUD service. So we can create, read, update and delete entries in a postgres database. This video explains which spring dependencies are needed, how to setup postgres database, with flyway schema scripts and configuration of the spring boot service. We apply best practices like three layer architecture and use Spring Data R2DBC with reactive repositories to access the database.

(00:00) - Intro
(01:53) - Spring Initializr
(04:20) - Prepare PostgreSQL
(05:49) - Setup Flyway with Database Schema
(07:36) - Configure Spring Data R2DBC
(09:40) - Three Layer Architecture / Tier-3 Architecture
(10:55) - Create a Controller and DTO
(16:16) - Create a Service Class
(21:38) - Create a Entity and Reactive Repository
(30:08) - Test CRUD Requests
(32:52) - Get a List of Entities
(36:15) - Outro
Рекомендации по теме
Комментарии
Автор

A short and comprehensive video, add more of webflux with microservice

danielmigwi
Автор

There is a bit more trickery on the controller annotations that will make it a true reactive endpoint emitting a true stream of events. The way it is implemented here is not a true stream to the client.. Create a delay in the service class, add a couple more car records, and then check the client waiting for all the records to be read by the service before the controller will eject the data.

kappaj
Автор

Hey dude i've got a question and need some help. I'm making a search in the database via repository and setting the result into an object. The issue is that i need to treat that data on the object that i have just fetched by using it as an argument in methods or even to transform it into a dto but the it always turns into null. Sometimes i've also got another problem that the data came from the database is null and sometimes it brings the data up, and in this case it looks like there weren't enough time to bring the data once it's reactive. Any tip of what i can do?

leandroquintiliano
Автор

Thanks for the videos, good explanation. I would recommend you to use domain driven design for writing your code in the mainstream approach.)

yyqwxcb
Автор

i have a question my friend. when h2 is implement this way, do we no longer have access to the h2 console? i see the data with the GETs, POSTS, PUTS, and DELETES, but i cant access the console to run queries and compare results like youre doing in this video

securethebag
Автор

you could use @Data instead of using @Getter / @Setter and @Build, great tutorial btw

MarcosDelBasso
Автор

Very good video brother, but what should be done in case your table has a one-to-many relationship with another? With JPA we use @OneToMany, but that is not available in r2dbc which strategy should be followed?

danielrt
Автор

What if id is not autogenerated and for save, update or query we get it as part of request only?

rajeev
Автор

thank you man for your video!
can you please write which tool in this video you used for hinting ?

vazhabek
join shbcf.ru