Open jackmew opened 10 years ago
Page ==> stronger List => add page Number , page size , and give some method to call.
so Page == 1. List + 2. PageRequest(Pageable)
PageRequest implements Pageable
We can see that PageRequest is combined with 1.page(page number) 2. size(how many record in a page) 3.Sort
repository :
public interface PersonRepository extends JpaRepository<Person,Long>
We can find that findAll() returned two type => 1.List 2. Page
PAGE_SIZE = 2; defined there are two record in a page .
PAGE_SIZE = 2;
Service :
Controller :
pageNumber is a condition to decide which page to fetch out..
Due to Page is a stronger List , so I guess the way jquery ajax call is the same way like before. And Success
findAll() , find with condition.
my note
Page
Page ==> stronger List => add page Number , page size , and give some method to call.
so Page == 1. List + 2. PageRequest(Pageable)
PageRequest implements Pageable
We can see that PageRequest is combined with 1.page(page number) 2. size(how many record in a page) 3.Sort
repository :
public interface PersonRepository extends JpaRepository<Person,Long>
We can find that findAll() returned two type => 1.List 2. Page
PAGE_SIZE = 2;
defined there are two record in a page .Service :
Controller :
pageNumber is a condition to decide which page to fetch out..
Due to Page is a stronger List , so I guess the way jquery ajax call is the same way like before. And Success
findAll() , find with condition.