{"id":45776732,"url":"https://github.com/nabildridi/primengtablespringfilter","last_synced_at":"2026-02-26T10:02:45.029Z","repository":{"id":336835577,"uuid":"1151328513","full_name":"nabildridi/PrimengTableSpringFilter","owner":"nabildridi","description":"Convert Primeng table json request (pagination, sorting and filtering) to a JPA specification","archived":false,"fork":false,"pushed_at":"2026-02-13T14:32:29.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-13T23:09:03.922Z","etag":null,"topics":["java","primeng","primeng-table","spring-boot","spring-data-jpa","spring-data-jpa-specification","spring-jpa","springfilter","turkraft"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nabildridi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T10:28:32.000Z","updated_at":"2026-02-13T14:32:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nabildridi/PrimengTableSpringFilter","commit_stats":null,"previous_names":["nabildridi/primengtablespringfilter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nabildridi/PrimengTableSpringFilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabildridi%2FPrimengTableSpringFilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabildridi%2FPrimengTableSpringFilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabildridi%2FPrimengTableSpringFilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabildridi%2FPrimengTableSpringFilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabildridi","download_url":"https://codeload.github.com/nabildridi/PrimengTableSpringFilter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabildridi%2FPrimengTableSpringFilter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29855963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","primeng","primeng-table","spring-boot","spring-data-jpa","spring-data-jpa-specification","spring-jpa","springfilter","turkraft"],"created_at":"2026-02-26T10:02:25.639Z","updated_at":"2026-02-26T10:02:45.024Z","avatar_url":"https://github.com/nabildridi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ## This project is a rewrite  of my other archived project [SpringBootGenericPagingFilteringForPrimengTable](https://github.com/nabildridi/SpringBootGenericPagingFilteringForPrimengTable) to make it simple and easy to install\n\u003e \n##  Spring Boot filter to convert PrimeNg table json request to JPA specification (paging, sorting and filtering for PrimeNg tables)\n  \n\n## Goal of the project\n\nPrimeNg tables have a 'lazy' mode when displaying data, it sends all the requests of paging, sorting and filtering to the server to be processed.\nThe goal of the this project is to make this server side processing the most generic possible (Spring boot).\n\n[![Sonatype Central](https://maven-badges.sml.io/sonatype-central/io.github.nabildridi/PrimengTableSpringFilter/badge.svg?subject=Maven%20Central\u0026color=blue)](https://mvnrepository.com/artifact/io.github.nabildridi/PrimengTableSpringFilter/1.3)\n\n\n### Step 1 : Add the dependency to your project\n```xml\n    \u003cdependency\u003e    \n\t    \u003cgroupId\u003eio.github.nabildridi\u003c/groupId\u003e    \n\t    \u003cartifactId\u003ePrimengTableSpringFilter\u003c/artifactId\u003e    \n\t    \u003cversion\u003e1.3\u003c/version\u003e    \n    \u003c/dependency\u003e\n```\n\n### Step 2 : Configure your Primeng table to work in 'lazy' mode\n[How-to documentation](https://primeng.org/table#virtual-scroll-lazy)\n\n### Step 3 : Send the Primeng request to the server\n```javascript\n      loadUsersFromServer(event: TableLazyLoadEvent) {\n        event.globalFilter = ['username', 'lastname'];\n        this.http.post('http://dev.local/paginateUsers', event).subscribe({\n          next: (json: any) =\u003e {\n            if (json) {\n              this.data.set(json['content']);\n              this.totalRecords = json['totalElements'];\n            }\n          },\n          error: (e) =\u003e {\n            console.log('error');\n          },\n        });\n      }\n```\n### Step 4 : Add JpaSpecificationExecutor to your repository:\n\nExample  :\n```java\n    @Repository\n    public  interface UsersRepository extends JpaRepository\u003cUser, Long\u003e, JpaSpecificationExecutor\u003cUser\u003e {\n```\n\n\n\n### Step 5 : Write your Spring boot controller like this :\n```java\n    import org.nd.primeng.model.User;    \n    import org.nd.primeng.repositories.UsersRepository;    \n    import org.springframework.beans.factory.annotation.Autowired;    \n    import org.springframework.data.domain.Page;    \n    import org.springframework.data.domain.Pageable;    \n    import org.springframework.data.jpa.domain.Specification;    \n    import org.springframework.web.bind.annotation.PostMapping;    \n    import org.springframework.web.bind.annotation.RestController;   \n    import  com.turkraft.springfilter.boot.Filter;    \n    import com.turkraft.springfilter.boot.Pagination;    \n         \n    @RestController    \n    public  class UsersController {    \n\t    @Autowired   \n\t    private UsersRepository usersRepository;\n\t    \n\t    @PostMapping(value = \"/paginateUsers\")    \n\t    public Page\u003cUser\u003e paginate(@Filter Specification\u003cUser\u003e spec, @Pagination Pageable page) {  \n\t\t    return  usersRepository.findAll(spec, page);    \n\t    }\n    }\n```\nThe *Specification* and *Pageable* objects are automatically generated by [Turkraft SpringFilter](https://github.com/turkraft/springfilter) from the data provided by this project after parsing the Primeng json request.\n\nThe only thing that you need to do is to call **findAll** function of your target respository.\n\n### What is supported by this project\nAll the functions of Primeng table are supported : \n\n - Pagination\n - Sorting (single sort and multiple sort)\n - All types of column filters (multiSelect, number, string, date, boolean and decimal)\n - 'filterGlobal' input mode\n\n\n### How to specify the fields that the global filter will look into?\n\nSee step 3, if you want to use the global filter, you need to specify what columns in your JPA entity to look into, for example, if you specify :\n```javascript\n    event.globalFilter = ['username', 'lastname'];\n```\nThen when the user types 'Fred' in the global filter input, Spring will looks for values containing 'Fred' in **username** and **lastname** columns.\n\n\n\u003e [!CAUTION]\n\u003e ### Important note :\n\u003e **Don't** add this annotation to your spring boot application\n\u003e   \n\u003e ```java\n\u003e @EnableSpringDataWebSupport(pageSerializationMode = PageSerializationMode.VIA_DTO)\n\u003e ```\n\u003e   \n\u003e That annotation generates a problem in the sort parameter of [Turkraft SpringFilter](https://github.com/turkraft/springfilter)  \n\n\n### Does this project work in Spring boot 4.x?\nNo, it doesn't work because its main dependency doesn't support Spring boot 4.x, as soon as the situation changes then I will update the project.\n\n### Minimum required Java version :\nJava 17\n\n### Tested on :\n\n - Spring boot version 3.5.10\n - Angular version 21.1.0\n - Primeng version 21.0.4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabildridi%2Fprimengtablespringfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabildridi%2Fprimengtablespringfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabildridi%2Fprimengtablespringfilter/lists"}