Allow Supertypes Specifications in JpaSpecificationExecutor #3300
Labels
for: team-attention
An issue we need to discuss as a team to make progress
status: waiting-for-triage
An issue we've not yet triaged
See the following commit: 4c45125
I added a test in your codebase which is exactly the same as I am going to describe.
Suppose we have an abstract
@MappedSupperclass
AbstractMappedType
and a concrete entityConcreteType1
extendingAbstractMappedType
.Then we also have
MappedTypeRepository
which is a@NoRepositoryBean
but does extendJpaSpecificationExecutor
and must therefore look like this:However when using this repository in its abstract form, we face some issues.
This does not work because
Specification<AbstractMappedType>
cannot be applied as first parameter forList<T> findAll(Specification<T> spec);
ofJpaSpecificationExecutor<T>
.IMO, the method
JpaSpecificationExecutor#findAll
should be defined as follows, accepting also specifications of supertypes ofT
.In fact, I have already implemented change, and you can have a look at #3301
The text was updated successfully, but these errors were encountered: