From the course: Build Spring Boot Apps with the Kotlin Programming Language
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Solution walk-through
From the course: Build Spring Boot Apps with the Kotlin Programming Language
Solution walk-through
- [Instructor] Okay, well I hope you have done it, I'll do the work now. I think we'll start with this find booking one, so in booking service, we're creating a function called find booking. That takes two parameters which are a seat and a performance. And it's going to return an object of type, booking. So let's import booking, first of all. What we'll need to do in here is go to our booking repository and see if we can find any booking that matches the ones we're looking for with our seat and performance. Well actually, it's the same code as we've got up here in is seat three, so I think what we could do is cut this from here and paste it down there. Actually, let's make this a null-able booking and then what we could do is return matched bookings.first or null. So getting the list of bookings, we're saying if there is one, return it. If not, return a null. So that's our find booking, and then up here when we do is seat three, we can say let's set matched bookings to our find…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Step 1: Explaining the challenge4m 9s
-
(Locked)
Solution walk-through2m 33s
-
(Locked)
Mappings between entities7m 33s
-
(Locked)
Upgrading the view11m 25s
-
(Locked)
Step 2: Explaining the challenge2m 26s
-
(Locked)
Solution walk-through9m 4s
-
(Locked)
Step 3: Explaining the challenge3m 21s
-
(Locked)
Solution walk-through4m 21s
-
(Locked)
-