You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use Query DSL in a Kotlin App and intend to query a relationnal database. I want to minimize my controller response using a DTO transformation using <U> Page<U> map(Function<? super T, ? extends U> converter);
to convert my Entity into a DTO but the QuerydslBindingsFactory want to use a predicate of my DTO instead of the entity.
I didn't succeed of using Fluent Query for projection so I tried with Page mapping and even with QuerydslPredicate It still search for a QDto class
My expectation :
When I use QuerydslPredicateExecutor as interface I expect that he try to use predicate from the entity and not the controller response
Steps to reproduce
Controller
@RestController
@RequestMapping(value = ["/path"])
class MyController(val myService: MyService) {
@GetMapping
fun get(predicate: Predicate, pageable: Pageable) = myService.get(predicate, pageable)
}
Service
@Service
class MyService(val myRepository: MyRepository) {
fun get(@QuerydslPredicate(root = Entity::class) predicate: Predicate, pageable: Pageable) : Page<Entity> = myRepository.findAll(predicate, pageable)
}
Observed vs. expected behavior
I try to use Query DSL in a Kotlin App and intend to query a relationnal database. I want to minimize my controller response using a DTO transformation using
<U> Page<U> map(Function<? super T, ? extends U> converter);
to convert my Entity into a DTO but the QuerydslBindingsFactory want to use a predicate of my DTO instead of the entity.
I didn't succeed of using Fluent Query for projection so I tried with Page mapping and even with QuerydslPredicate It still search for a QDto class
My expectation :
When I use QuerydslPredicateExecutor as interface I expect that he try to use predicate from the entity and not the controller response
Steps to reproduce
Controller
Service
Repository
Environment
Querydsl version: 5.0.0
Querydsl module: 5.0.0
Database: MSSQL
JDK: 17
Additional details
The text was updated successfully, but these errors were encountered: