Spring Boot & JPA: Implementing search queries with optional, ranged criteria

You can achieve complex queries with specifications by JpaSpecificationExecutor in spring data. Repository interface must extend the JpaSpecificationExecutor<T> interface so we can specify the conditions of our database queries by creating new Specification<T> objects. The trick is in the use of the Specification interface in combination with a JpaSpecificationExecutor. here is the example: @Entity @Table(name … Read more