Spring boot pagination and sorting using jpa and thymeleaf spring data dialect

preview_player
Показать описание
#springboot #pagination #sort #springpagination #springbootdialect #springbootsort #thymeleaf
Spring boot_ pagination and sorting using jpa and thymeleaf spring data dialect
Prerequisite
1. already familiar creata application using springboot
2. already added thymeleaf dependency
3. already familiar config thymeleaf and admin lte template
4. i use spring boot version 2.6.6

Let's jump right in
1. add dependency spring data dialect
2. add dialect to the template engine in the main class
@Bean
public SpringDataDialect springDataDialect() {
return new SpringDataDialect();
}
3. create entity class
4. create repository class
5. create controller class
- add pagable size
- add default sort(in this example sort by first_name)
- mapping pagable object into template
5. create template using bootstrap
- create table in html
- loop data already mapped and put on the table
- add dialect sort in table header
- add dialect pagination under table
- run app
Succeed, happy learning and happy sharing :)
Рекомендации по теме
Комментарии
Автор

good background music, nice title and awsome teacher🤩🤩

mohammadjavadshabani
visit shbcf.ru