jackmew / sbJPA

0 stars 0 forks source link

Pagination #9

Open jackmew opened 10 years ago

jackmew commented 10 years ago

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

image

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>

image

We can find that findAll() returned two type => 1.List 2. Page

PAGE_SIZE = 2; defined there are two record in a page .

Service :

image

Controller :

image

pageNumber is a condition to decide which page to fetch out..

image

Due to Page is a stronger List , so I guess the way jquery ajax call is the same way like before. And Success

image

findAll() , find with condition.

image

jackmew commented 10 years ago

my note