reading-notes

Spring RESTful Routing & Static Files

Spring RequestMapping

There are many applications to use RequestMapping

form more example visit this site resources

Accessing Data with JPA

There are many applications to JPA

form more example visit this site resources

Baeldung: Comparing repositories

there is different kinds of Spring Data repository interfaces and their functionality :

  1. CrudRepository : provides CRUD functions
  2. PagingAndSortingRepository : provides methods to do pagination and sort records
  3. JpaRepository : It contains the full API of CrudRepository and PagingAndSortingRepository ,So it contains API for basic CRUD operations and also API for pagination and sorting

CrudRepository

the typical CRUD functionality is :

  1. save
  2. findOne
  3. findAll
  4. count
  5. delete
  6. exists

JpaRepository

the typical CRUD functionality is :

  1. findAll()
  2. save
  3. flush
  4. saveAndFlush
  5. deleteInBatch

PagingAndSortingRepository

When using Pageable, we create a Pageable object with certain properties and we’ve to specify at least:

  1. Page size
  2. Current page number
  3. Sorting

form more information visit this site resources