Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query DSL + JPA Repository + Page mapping = Unable to find Querydsl root type for detected domain #3642

Open
ASaludo opened this issue Dec 5, 2023 · 2 comments
Labels

Comments

@ASaludo
Copy link

ASaludo commented Dec 5, 2023

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

@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)

}

Repository

@Repository
interface MyRepository: JpaRepository<Entity, Float>, QuerydslPredicateExecutor<Entity>

Environment

Querydsl version: 5.0.0

Querydsl module: 5.0.0

Database: MSSQL

JDK: 17

Additional details

@ASaludo ASaludo added the bug label Dec 5, 2023
@H-Lo
Copy link

H-Lo commented Dec 6, 2023

Good luck with that because this project is abandoned.

@Oodachi
Copy link

Oodachi commented Dec 8, 2023

https://github.com/OpenFeign/querydsl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants