Category: Spring

  • Java – What is difference between CrudRepository and JpaRepository interfaces in Spring Data JPA?

    Java – What is difference between CrudRepository and JpaRepository interfaces in Spring Data JPA? JpaRepository extends PagingAndSortingRepository which in turn extends CrudRepository. Their main functions are: CrudRepository mainly provides CRUD functions. 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. Because of the inheritance mentioned…