Leave a Reply

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

Notify of
avatar

Nikhil Urkude
Guest
Nikhil Urkude
3 months 17 days ago

For deleting I used the following code:for(Iterator<Topic> it = list.iterator();it.hasNext();) { Topic t = it.next(); if(t.getId().equals(id)) { it.remove(); } }

Ngọc Dex
Guest
Ngọc Dex
4 months 23 days ago

You can use this instead of Lambda Expression: for (TopicEntity t : listTopics) { if (t.getId().equals(id)) { listTopics.set(listTopics.indexOf(t), topic); } }

Yinning Liu
Guest
Yinning Liu
4 months 30 days ago

Get Error for removeif. Who knows why? the error is { "timestamp": 1521627943493, "status": 500, "error": "Internal Server Error", "exception": "java.lang.NullPointerException", "message": "No message available", "path": "/topics/spring"}

Ngọc Dex
Guest
Ngọc Dex
4 months 23 days ago

i think it should be /topic/spring instead of /topics/spring

Yu Chen
Guest
Yu Chen
5 months 5 days ago

Really nice course on Spring Boot! Map is perfect for storing the Course Info in memory 1) constant-time performance 2) Also, avoid all the lambda expressions and for loops.

jesse2006
Guest
jesse2006
5 months 11 days ago

is looping through a list every time to update a list of topics efficient when this scales to an enterprise application?

Software Bugs
Guest
Software Bugs
6 months 25 days ago

I have one confusion. when updateTopic is called in TopicService, it updated the list. That's fine but when getAllTopics is called how it be able to return the updated list because it is completely new request and it should return the hardcoded list i.e the instance variable. how this is happening??? can anyone please explain….

ankit malhotra
Guest
ankit malhotra
8 months 1 day ago

while passing json data for PUT I used "id " instead of "id" and similar to other Topic propertiesand it wasn't updating……spent whole day and realized this mistake and felt so angry-_-

Piyush W
Guest
Piyush W
8 months 17 days ago

I used following instead of regular for loop in PUT, works fine
topics.stream().filter(t->t.getId().equals(id))
.map(t->topics.set(topics.indexOf(t), topic))
.collect(Collectors.toList());

Piyush W
Guest
Piyush W
8 months 17 days ago

I used following instead of regular for loop in PUT, works finetopics.stream().filter(t->t.getId().equals(id)) .map(t->topics.set(topics.indexOf(t), topic)) .collect(Collectors.toList());

Agata Niemczycka
Guest
Agata Niemczycka
8 months 29 days ago

Hi, one question here – When I try to update one of the topics using PUT method I receive a message "Method [updateTopic] was discovered in the .class file but cannot be resolved in the class object". Any ideas how to solve the problem? I've already reset the project and tried to compare if there aren't any misspellings

1 2 3 5
wpDiscuz