title: Spring Data JPA inheritance in repositories
body: <p>I have an abstract class annotated with <code>@MappedSuperClass</code>. There are around 15 entities that extend this abstract class (having 15 corresponding tables in the database). The 15 entities all have the same attributes that are inherited from the abstract super class.</p>
  
  <p>I have created a repository as below for the abstract class:</p>
  
  <pre><code>@NoRepositoryBean
  public interface AbstractRepository &lt;T extends AbstractClass, E extends Serializable&gt;
                                      extends PagingAndSortingRepository&lt;T, Serializable&gt; {
    .....some methods here
  }
  </code></pre>
  
  <p>The 15 entities/tables store some data (data pertaining to 15 separate equipment). Based on the equipment selected, the data from that table is to be retrieved. Will I have to create 15 separate repositories for the 15 concrete entities or is there any way to get the specific entity for the equipment selected using only the abstract repository? If repositories need to be created for each concrete entity, how to get the right repository for the specific equipment call? (store the table name and repository class in a map that gets created on startup of the application perhaps?)</p>