Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Spring Data Repository with unresolved generics cannot be injected anymore #1324

Closed
snicoll opened this issue Dec 1, 2021 · 1 comment
Closed
Assignees
Labels
type: regression A bug that is also a regression
Milestone

Comments

@snicoll
Copy link
Contributor

snicoll commented Dec 1, 2021

Regression reported by @christophstrobl.

What we've done in #1292 means that we will remove the generic type of a bean definition that has unresolved generics.

Consider the following repository:

interface SomethingRepository extends PagingAndSortingRepository<Something<?>, Long> {

Because the target entity is a Something<?> we do remove the generics and this prevents SomethingRepository to be found as a candidate bean. We should fix that problem, which may require change in Spring Data but for now we will add a workaround for that specific use case.

@snicoll snicoll added the type: regression A bug that is also a regression label Dec 1, 2021
@snicoll snicoll added this to the 0.11.0 milestone Dec 1, 2021
@snicoll snicoll self-assigned this Dec 1, 2021
snicoll added a commit that referenced this issue Dec 1, 2021
With gh-1292, we've stopped writing a resolvable type if it has
unresolved generics. This broke Spring Data repository support as a
repository may have such a signature and the context is not able to
locate the type if the target type is not set.

This is a workaround that provide a way to opt-in for such a type even
if it has unresolved generics.

See gh-1324
@snicoll
Copy link
Contributor Author

snicoll commented Dec 1, 2021

Closed by 82dac3f

@snicoll snicoll closed this as completed Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that is also a regression
Development

No branches or pull requests

1 participant