Java 带querydsl的Spring引导使用函数创建查询

Java 带querydsl的Spring引导使用函数创建查询,java,spring-boot,geolocation,querydsl,Java,Spring Boot,Geolocation,Querydsl,我正在使用带有querydsl的Spring Boot。我需要以某种方式构建此查询,但我无法做到: SELECT address.id, address.city FROM address WHERE earth_box( ll_to_earth(48.97300592, 8.32746506), 3100) @> ll_to_earth(address.lattitude, address.longitude); 我尝试在我的customize()方法中自定义该参数的绑定方法 如何生成

我正在使用带有querydsl的Spring Boot。我需要以某种方式构建此查询,但我无法做到:

SELECT address.id, address.city FROM address WHERE earth_box( ll_to_earth(48.97300592, 8.32746506), 3100) @> ll_to_earth(address.lattitude, address.longitude);
我尝试在我的
customize()
方法中自定义该参数的绑定方法

如何生成此查询

编辑:

ArticleRepositoryImpl中的My customize()方法

@Override
    public void customize(QuerydslBindings bindings, QArticle root) {

        bindings.bind(root.address.city).first((path, value) -> {

            Predicate city = root.address.city.eq(value); // Here i need to build my Predicate, which is my SqL query in the top

            return city;
        });
和我的休息控制器:

@RequestMapping(method = RequestMethod.GET, value = "/article")
    public ResponseEntity<Page<QArticle>> findAll(@QuerydslPredicate(root = Article.class) Predicate predicate,
            Pageable p) {

        System.out.println(predicate.toString());
        Page<QArticle> resultPage = repo.findAll(predicate, p);

        return new ResponseEntity<Page<QArticle>>(resultPage, HttpStatus.OK);
    }
@RequestMapping(method=RequestMethod.GET,value=“/article”)
public ResponseEntity findAll(@QuerydslPredicate(root=Article.class)谓词,
可分页(p){
System.out.println(predicate.toString());
页面结果页面=repo.findAll(谓词,p);
返回新的ResponseEntity(结果页,HttpStatus.OK);
}

显示您所做的编辑我的评论和编辑我的自定义方法。我没有更多,因为我对qerydsl完全是新手,我不知道如何实现我的谓词。如果你能帮忙就好了