Dynamically build queries using JPA Criteria API/Specification
jpa-specifications
│
├─ org.example.jpaspec
│ │
│ ├─ controller
│ │ └─ ProductController.java
│ │
│ ├─ service
│ │ └─ ProductService.java
│ │
│ ├─ dto
│ │ ├─ ProductRepository.java
│ │ └─ ProductCategoryRepository.java
│ │
│ ├─ entity
│ │ ├─ ProductRepository.java
│ │ └─ ProductCategoryRepository.java
│ │
│ ├─ repository
│ │ ├─ ProductRepository.java
│ │ └─ ProductCategoryRepository.java
│ │
│ ├─ specification
│ │ ├─ ProductSpecification.java
│ │ └─ SpecificationCollector.java
│ │
│ └─ JpaSpecificationsApplication.java
│
...
GET http://localhost:8080/products?name=ap&costTo=1000&costFrom=50&category=FRUITS