Repository interface for the entity

In the src/main/java/com/mycompany/store/repository folder, you will find the entity repository service. Open ProductRepository.java:

@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {

}

The repository service is just an empty interface that extends the JpaRepository class. Since it is a Spring Data repository, the implementation is automatically created, allowing us to perform all CRUD actions using this simple interface declaration. Additional repository methods can be added here easily. We will learn more about this in the next chapter.

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

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