Spring JPA Generic Criteria
Production-ready DTO to JPA-Specification converter with multi-join support
View on GitHubSpring JPA Generic Criteria
A powerful library that converts DTOs to JPA Specifications with support for multi-joins, making database querying more flexible and maintainable.
Features
- Automatic conversion from DTO to JPA Specifications
- Support for complex multi-join queries
- Flexible criteria building
- Easy integration with Spring Boot applications
- Production-ready with extensive testing
Usage
@Getter
@Setter
public class UserSearchDTO {
private String name;
private Integer age;
@Join("addresses")
private AddressSearchDTO address;
}
// In your repository
List<User> users = userRepository.findAll(searchDTO.toSpecification());
Benefits
- Reduces boilerplate code
- Improves code maintainability
- Provides type-safe queries
- Supports complex database operations
- Easy to integrate and use