Thursday, 25 June 2020

Difference between CrudRepository and JpaRepository in Spring Data JPA

      In this post, we will see difference between CrudRepository and JpaRepository in Spring Data JPA. These two CrudRepository and JpaRepository are the interfaces of the Spring Data Core library.

      The JpaRepository extends CrudRepository and it inherits some of the methods available in the CrudRepository like findOne, get and so on. And JpaRepository also extends PagingAndSorting Repository uses for Pagination and Sorting purpose.

    The CrudRepository and PagingAndSortingRepository are the base interfaces of Spring Core library and it has below functionalities,
  • CrudRepository - Provides CRUD Operations.
  • PagingAndSortingRepository - Provides methods to do pagination and sorting records.
  • JpaRepository - Provides some JPA related methods such as flushing the persistence context and deleting records in a batch.

Difference between CrudRepository and JpaRepository


Thank you for visiting blog.


Related Posts:-