Skip to content

Allow generic type parameter for QuerydslRepositorySupport. - #4302

Open
NewRecon wants to merge 1 commit into
spring-projects:mainfrom
NewRecon:gh-4300-add-generic-type
Open

Allow generic type parameter for QuerydslRepositorySupport.#4302
NewRecon wants to merge 1 commit into
spring-projects:mainfrom
NewRecon:gh-4300-add-generic-type

Conversation

@NewRecon

Copy link
Copy Markdown

Closes #4300

This PR aligns QuerydslRepositorySupport with the rest of Spring Data by inferring the domain type from generics, removing the need for manual constructor arguments.
The existing constructor is kept to ensure full backward compatibility.

Changes

  • Extracted common logic into a new QuerydslRepositorySupportBase class.
  • Made QuerydslRepositorySupport<T> generic.
  • getBuilder() now returns a properly typed PathBuilder<T> instead of PathBuilder<?>.
  • Added an integration test to verify that a repository extending QuerydslRepositorySupport<User> (without an explicit constructor) correctly resolves the domain type and initializes the EntityManager.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 22, 2026
@NewRecon
NewRecon force-pushed the gh-4300-add-generic-type branch from 6083ff5 to d93ba71 Compare July 22, 2026 22:18
Closes spring-projects#4300

Signed-off-by: Maxim Shabanov <99maxwolf99@gmail.com>
@NewRecon
NewRecon force-pushed the gh-4300-add-generic-type branch from d93ba71 to d5534f5 Compare July 23, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow generic type parameter (no-args subclassing) for QuerydslRepositorySupport

2 participants