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.