如何从QueryDSL Spring引导中提取参数?
众所周知,queryDSL可以将和平谓词作为参数,但是如何从此queryDSL中提取参数?因为我必须获得我在邮递员中通过的ID,以便可以使用它。
那是我的控制器:
@GetMapping
ResponseEntity<Page<MedicalDataDto>> getMedicalData(Pageable pageable, @QuerydslPredicate(root = MedicalData.class) Predicate predicate){
return ResponseEntity.ok(medicalDataService.getMedicalData(pageable,predicate));
}
As we know that Querydsl get Peageable and Predicate as parameters but how can I extract the params from this querydsl? because I must get the Id that I passed in postman so that I can use it.
That's my controller :
@GetMapping
ResponseEntity<Page<MedicalDataDto>> getMedicalData(Pageable pageable, @QuerydslPredicate(root = MedicalData.class) Predicate predicate){
return ResponseEntity.ok(medicalDataService.getMedicalData(pageable,predicate));
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用类
com.querydsl.core.types.predicateoperation
(在一个以上的查询条件下)使用类
com.querydsl.core.core.types.dsl.booleanoperation
(在单个查询条件的情况)。在这里是类似的问题。
use class
com.querydsl.core.types.PredicateOperation
(in case of more than one query conditions)use class
com.querydsl.core.types.dsl.BooleanOperation
(in case of single query condition).here is the similar question.