From the course: Creating Your First Spring Boot Microservice

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Explore the /search resource

Explore the /search resource

From the course: Creating Your First Spring Boot Microservice

Start my 1-month free trial

Explore the /search resource

- Every entity that spring data rest exposes also creates a slash search endpoint. Let's see what happens when we envoke the tour packages slash search. Other than the self href we also see a findByName attribute. Let's click on that. That maps directly to the method we created in tour package repository FindByName and we have an example of what the parameter is, so let's actually put that in. And give it a name BackpackCal. We need to put the percent 20 in there because that's at the ASCII value for space and an actual space is not allowed on a URL. And we get back these tour packages BC. So now that we know how slash search resource works, let's create a tour repository method. I want to create a method to find all tours associated with the tour package by the code. So add a new method in here. Since tour package could be associated with many tours it would be in a list. Find by tour package code. (typing)…

Contents