Given the list of all spring data repositories in some class Bar
:
@Autowired
private List<Repository> repositories;
How can I find the repository for an existing domain class Foo
in the above list?
Assuming that the following exists:
@Entity
public class Foo {
...
}
and
public interface FooRepository extends JpaRepository<Foo, String> {}
See Question&Answers more detail:os