Q:

Spring Data REST making range check with QueryDSL binding

I have request like this:
http://localhost:4000/services/querywithdsl?min=30&max=90
My domain entity only consists of id :
@Entity
@Data
public class ServiceNumberPorting {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(updatable = false, nullable = false)
    private Long id;
}

And my rest controller with predicate
@GetMapping(value = "/services/querywithdsl")
    public ResponseEntity<List<ServiceNumberPortingMapper>>getServiceNumberPortingWithDsl(@QuerydslPredicate(root = ServiceNumberPorting.class) Predicate predicate) {
        ...

    }

Repository:
public interface ServiceNumberPortingRepository extends JpaRepository<ServiceNumberPorting, Long>,QuerydslPredicateExecutor<ServiceNumberPorting>,    QuerydslBinderCustomizer<QServiceNumberPorting>

I want to build query with querydsl like this one using bindings
..where id>min and id< max

All examples I found are directly mapping query parameters to entity column, but in this example, I have only id in my entity and I want to do range check with incoming parameter values which have different name than my entity columns.
However, since my domain won't consist of min and max columns I could't get it working with customizing binding such as using QueryDslBinderCustomizer:
bindings.bind(store.city).single((path, value) -> path.endsWith(value));

How to accomplish that?
Here is docs that I gone through:
spring data examples
binding examples

A:

One of the solutions I can think of is this:
In your repository,I have defined a method getValueLyingBetween and written a simple query:
public interface ServiceNumberPortingRepository extends JpaRepository...{
    @Query("SELECT m FROM <YOUR_TABLE_NAME> m where ( m.id >=:min and m.id <= :max )")
    public ServiceNumberPorting getValueLyingBetween(@Param("min") String min, @Param("max") String max);

}

And then you can simply call this repository method from your controller with min and max values.
Is this what you were looking for?

