February 2018
Intermediate to advanced
356 pages
9h 10m
English
Our Plane class needs a repository to persist the data to a database. We will use a reactive repository for MongoDB provided by the Spring Reactive MongoDB implementation. We will use the ReactiveCrudRepository as it makes our repositories reactive. Our repository should be like this:
package springfive.airline.airlineplanes.repository;import org.springframework.data.repository.reactive.ReactiveCrudRepository;import springfive.airline.airlineplanes.domain.Plane;public interface PlaneRepository extends ReactiveCrudRepository<Plane,String>{}
The implementation is the same as it was in the previous Spring Data versions, except for the new reactive interface. Now, we can create our service layer in the next section.
Read now
Unlock full access