Leave a Reply

20 Comments on "Spring Boot Quick Start 20 – Implementing Update and Delete"

Notify of
avatar

Wayne Covell
Guest
Wayne Covell
3 hours 59 minutes ago

For those asking for a simpler expression for the updateTopic, you can use:

public void updateTopic(String id, Topic topic) {
topics = topics.stream().map(t -> {
return t.getId().equals(id) == true ? topic : t;
}).collect(Collectors.toList());
}

Sireesh V
Guest
Sireesh V
4 days 16 hours ago

We can make use of @GetMapping, @PostMapping, @PutMapping and @DeleteMapping in place of @RequestMapping(method=RequestMethod….)

Guram Kankava
Guest
Guram Kankava
10 days 4 hours ago

Thank you very much. clear and simple. "Everything genius is simple".

Niroz Jung Karki
Guest
Niroz Jung Karki
12 days 10 hours ago

How can I use Lambda expression inside update method instead of For Loop.

Wayne Covell
Guest
Wayne Covell
3 hours 58 minutes ago

Please see my latest comment for this answer.

Bharath loka
Guest
Bharath loka
17 days 22 hours ago

So if I want to update the id I have to compare all other fields and if all of them matches I can update the id right. Is there any other way to do it

Wayne Covell
Guest
Wayne Covell
3 hours 58 minutes ago

Please see my latest comment for this answer.

Irakli Tabagari
Guest
Irakli Tabagari
1 month 20 days ago

Hi,Is Spring "@Service" always "@Singleton" by default??

Sergey Orlovich
Guest
Sergey Orlovich
3 months 7 days ago

You're mistaken in using PUT for update. PUT is used for insert in RESTful api, and POST is for update. Nice tutorial.

Priten Vora
Guest
Priten Vora
2 months 22 days ago

Actually, it is mentioned in the stackoverflow page that If client decides the URL of the object being created then it is okay to use PUT otherwise we can use POST for resource creation. However using POST for update is not the REST way to go.

Rama41222
Guest
Rama41222
2 months 23 days ago

@sergey lol You must be dreaming

Priten Vora
Guest
Priten Vora
3 months 6 days ago
Avijit Chatterjee
Guest
Avijit Chatterjee
5 months 17 days ago

Thanks a lot for this great tutorial, it was a huge help. It would be great if you could add a section on integrating Swagger into this app.

anup kumar
Guest
anup kumar
5 months 23 days ago
Very nice videos , very well explained :)One quick question : Can you please discuss the scenarios of thread saftey ?Scenario i would like you to cover and explain : 2 parallel Put request comes in and at the same time the Get Request comes in too .. Put Request 1 : {id = Java , XYZ…. }Put Request 2 : {id = Java , PQR….}Get Request 1 : {/topics/{java} }what would be the output ? and how thread saftey is handled ? … I am going through your tutorials now , once i am done will try this out… Read more »
Priten Vora
Guest
Priten Vora
3 months 6 days ago

Ideally you should get {id = Java , PQR….}

Vishwanath Gajavelly
Guest
Vishwanath Gajavelly
3 months 10 days ago

this is interesting, did you figure out anything reg the synchronization Anup ? Thanks..

shalini lakshkar
Guest
shalini lakshkar
6 months 11 days ago

These tutorials are pretty simple… very well explained.. Thanks.

wpDiscuz