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] So I hope you've had a go at that, I'll do the walkthrough now. We'll start in the booking service. So what we want to do is say, is there a booking for that seat and that performance? So I want to make use of the booking repository, we'll need to inject it into this class. So we'll start by autowiring in a lateinit var called bookingRepository, which is an object of type BookingRepository. Okay, so now in isSeatFree, we can say, let's get all of the bookings first of all, and that will be our bookingRepository.findAll. Then we can say our matched bookings are, take the bookings, filter on them, and we're interested in those bookings where the seat is equal to the seat that's been passed into this function, and the performance is equal to the performance passed into this function. So, now our matched bookings is a list of bookings that could be of size zero or one. I suppose in theory it could be bigger than one, but we want to know, is it zero or not really? If it is…
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)
-