O'Reilly logo

Reactive Programming With Java 9 by Tejaswini Mandar Jog

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the repository

The standard CRUD functionality repositories have the queries to fire on the underlying database. While working with Spring Data, the declaration of these queries is a five-step process as discussed next:

  1. Declaring the repository interface.
  2. Declaring the methods in the repository interface.
  3. Discovering the repository interface.
  4. Enabling the proxy creation of the interface.
  5. Using the repositories.

Let's discuss the following steps one by one:

  1. Declaring the repository interface: The first step for using the repository is to create an interface which will extend the Repository interface or any of its sub interfaces as shown here:
 interface EmployeeRespository extends Repository<Employee, Long> { // method declaration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required