full-reactive-stack icon indicating copy to clipboard operation
full-reactive-stack copied to clipboard

Create, update and Delete endpoints

Open shapan1 opened this issue 3 years ago • 1 comments

Hi, I went through your course on educative.io. I saw how you created the mongo repository and loaded data into the Mongo instance. However, I wanted to know :

  1. how the interface worked without an actual implementation?
  2. How can I create the other Create, update and delete endpoints?

shapan1 avatar Mar 31 '21 18:03 shapan1

Hi @shapan1,

  1. The interface doesn't need an implementation because it uses Spring Data JPA's Query Methods. In short, this means the name of the method is translated to a query by Spring.
  2. The ReactiveSortingRepository that the code uses extends the ReactiveCrudRepository interface. This one has methods to create, update, and delete entities. You can check the docs here.

If you want to know more about Spring Data and how it integrates with Spring Boot in a microservices architecture, let me recommend you my book Learn Microservices with Spring Boot.

In any case, feel free to ask as many questions as you need 😄

mechero avatar Apr 03 '21 06:04 mechero