title: Get supported type from Spring Data repository
body: <p>I have a list of repository beans existing in my Spring Boot application and I need to link each <code>CrudRepository</code> into corresponding entity class so I end with a <code>Map&lt;Class, CrudRepository&gt;</code> object.</p>
  
  <p>Example repository:</p>
  
  <pre><code>public interface ReviewRepository extends CrudRepository&lt;Review, ReviewId&gt; 
  </code></pre>
  
  <p>And I need help with the following method linking repository with a proper entity class:</p>
  
  <pre><code>@Service
  public class MyService {
  
      final Map&lt;Class, CrudRepository&gt; repositoryMap;
  
      public MyService(List&lt;Class&gt; entityClasses, List&lt;CrudRepository&gt; existingRepositories) {
          this.repositoryMap = logicGoesHere(entityClasses, existingRepositories); // &lt;== HERE
      }
  </code></pre>