How to inject a dependency into a repository base class

Viewed 1055

The various @EnableXXXRepository annotations of Spring Data allow you to specify a custom base class for your repositories, which will be used as an implementation of methods in your repository.

If such a base class needs access to other beans in the ApplicationContext how does one get those injected? It doesn't work out of the box, because Spring Data instantiates those base classes itself, supporting only special store dependent constructor parameters.

Note: I created this answer in the chat to this now deleted question and thought it might be valuable for others, although the original question is gone.

1 Answers
Related