Could not autowire No beans of "TaskRepository" found
warning in the
UpdateTaskDescriptionUseCase
class (attached image):
Here is repo class:
Copy code
@Repository
class TaskRepository {
// ...
}
The warning seems to be a false positive because the above code works fine (the repo class is injected into the use case)
I wonder whats the desired solution is here. Do I need another annotation together with the repo annotation?
d
Davio
03/02/2023, 8:17 AM
Your repository should probably be an interface instead of a concrete class, that's how it usually works
would be the typical way to use @Repository
It could also be that the TaskRepository is in a completely package than the rest of the application (so the package scan doesnt find it)
j
Jacob
03/02/2023, 2:15 PM
👎 @Repository does not imply a spring data repository. The annotation is in spring core, not spring data. It's perfectly legit to make your own implementation of the repository pattern