spring-projects / spring-projects/spring-data-commons

Support QueryDsl options in SimpleEntityPathResolver [DATACMNS-1658]

Open
#2,027 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 30, 2020.

type: enhancement
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

rob-valor opened DATACMNS-1658 and commented

QueryDsl has 3 options for defining the generated "Q" classes:

  • querydsl.prefix: override the prefix for query types(default: Q)
  • querydsl.suffix: set a suffix for query types
  • querydsl.packageSuffix: set a suffix for query type packages

org.springframework.data.querydsl.SimpleEntityPathResolver only supports configuration of querySuffix (querydsl.packageSuffix). The default querydsl.prefix is hardcoded in SimpleEntityPathResolver which prevents us from using that option. Please provide overloaded constructor(s) to align on the QueryDsl naming capabilities.

One of the problems is that Jacoco is complaining about non covered code. At the QueryDsl side there is actually the possibility to "drive" the code generation is a way that is Jacoco friendly. However, the issue with SimpleEntityPathResolver is that only the package can be customized which has a "devastating" impact on our Entities visibility because they are package private. So setting the querySuffix of SimpleEntityPathResolver is not an option. We could of course implement our own EntityPathResolver but to me it looks like a simple org.springframework.data.querydsl.EntityPathResolver could perfectly support those 3 options of QueryDsl.

That way we can have a simple ignore rule for classes starting with our prefix (or ending with a suffix)


Affects: 2.2.4 (Moore SR4)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.