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

Dependency to JPA Repository that implements another interface #62

Open
carljonescf opened this issue Nov 5, 2021 · 0 comments
Open

Comments

@carljonescf
Copy link

I have a JPARepository that implements another interface. The idea being that alternative implementations of the same interface could be applied. It's a conversation starter with students.

e.g.

public interface CharityRepositoryJPA extends JpaRepository<Charity, Long> , CharityRepository

I then have a service class that depends on CharityRepository. The Spring extension picks up the JPA repository as a component, but doesn't pick up the dependency.

Is there a way of naming the interfaces so that the dependencies are picked up correctly? At the moment, I seem to have to make the service class depend on the JPA interface directly.

Thanks

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

No branches or pull requests

1 participant