Implementation of Spring Data Redis repositories

With the domain model implemented successfully, CrudRepository for those can be implemented using Spring Data Redis. The specialty here is that there is no need to implement anything. Just writing an interface that extends from the CrudRepository interface would be sufficient to expose methods to find one, find all, save, delete, and so on. The following code shows the TaxiRepositorywhich is available in the spring-boot-2-taxi-service:

@Repository
public interface TaxiRepository extends CrudRepository<Taxi, String> {

}

The @Repository annotation is used to mark this interface as a data repository component of Spring. The following code shows TaxiBookingRepository, which is available in spring-boot-2-taxi-book-service:

@Repository
public interface TaxiBookingRepository extends CrudRepository<TaxiBooking, String> {

}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.236.70