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.
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
If you use spring boot with in memory H2 database, maybe the property 'spring.h2.console.enabled=true' can help you. Then you should be able to access it with 'localhost:8080/h2-console'. Thats from a tutorial I found on google. Maybe that helps you.
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?
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?
There is no choose. You should write your own native sql query with your joins and execute them by org.springframework.data.r2dbc.core.DatabaseClient. DatabaseClient client = …; client.execute("SELECT person.age, address.street FROM person INNER JOIN address ON person.address = address.id");
Afaik R2DB did not support relationship mapping, like OneToMany, ManyToOne or ManyToMany, the last time I checked it. So it is a simple but reactive object mapper.
A short and comprehensive video , add more of webflux with microservice
A short and comprehensive video
Gracias por el video. Esta excelente!
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.
Thanks for the videos, good explanation. I would recommend you to use domain driven design for writing your code in the mainstream approach.)
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
If you use spring boot with in memory H2 database, maybe the property 'spring.h2.console.enabled=true' can help you. Then you should be able to access it with 'localhost:8080/h2-console'. Thats from a tutorial I found on google. Maybe that helps you.
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?
thank you man for your video!
can you please write which tool in this video you used for hinting ?
github copilot
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?
There is no choose. You should write your own native sql query with your joins and execute them by org.springframework.data.r2dbc.core.DatabaseClient.
DatabaseClient client = …;
client.execute("SELECT person.age, address.street FROM person INNER JOIN address ON person.address = address.id");
What if id is not autogenerated and for save, update or query we get it as part of request only?
good question. I got the wonder
you could use @Data instead of using @Getter / @Setter and @Build, great tutorial btw
Thanks. However, I always got warning said that @Data in Entity class will cause performance issue. Ask me to use @Getter, @Settter... Any advice?
cool
why no relations?
Afaik R2DB did not support relationship mapping, like OneToMany, ManyToOne or ManyToMany, the last time I checked it. So it is a simple but reactive object mapper.
@@heygenka ah i see so i will go with quarkus + hibernate reactive, thanks