With Spring Data you can make a Repository for a given entity:
@Repository
public interface MyRepo extends CrudRepository<MyEntity, Long> {...}
But what if you have a lot of custom queries not tied to a specific Entity?
None of the below work:
@Repository
public interface MyRepo {...}
@Repository
public interface MyRepo extends CrudRepository {...}
@Component
public interface MyRepo extends Repository {...}
And so on..
Essentially what I want, is to be able to encapsulate some @Querys into an injectable class or interface.