title: Use abstract super class as parameter for Spring data repository
body: <p>I know how to implement spring data repositories,</p>
  <p>Create an interface like this :</p>
  <pre><code>public interface CountryRepository extends CrudRepository&lt;Country, Long&gt; {}
  </code></pre>
  <p>Now <code>Country</code> is an <code>AbstractCatalog</code> and I have (a lot) more catalogs in my project.<br/>
  I'm wondering if I can make only one repository that would work for all the catalogs:</p>
  <pre><code>public interface AbstractCatalogRepository extends CrudRepository&lt;AbstractCatalog, Long&gt; {}
  </code></pre>
  <p>Now I don't see a problem while saving, but if I want to search an <code>AbstractCatalog</code> I'm already sure that I'll hit the wall because the repository will not know which sub-class it must choose.</p>
  <h2>AbstractCatalog.class</h2>
  <pre><code>@MappedSuperclass
  public abstract class AbstractCatalog extends PersistentEntity {
  
      /**
       * The Constant serialVersionUID.
       */
      private static final long serialVersionUID = 1L;
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Integer id;
      /**
       * The code.
       */
      @Column(unique = true, nullable = false, updatable = false)
      private String code;
      /**
       * The description.
       */
      @Column(nullable = false)
      private String description;
      /**
       * The in use.
       */
      @Column(name = &quot;IN_USE&quot;, nullable = false, columnDefinition = &quot;bit default 1&quot;)
      private Boolean inUse = Boolean.TRUE;
  
      // getters and setters
  }
  </code></pre>
  <h2>Country.class</h2>
  <pre><code>@Entity
  @Table(name = &quot;tc_country&quot;)
  @AttributeOverrides({
      @AttributeOverride(name = &quot;id&quot;, column =
              @Column(name = &quot;COUNTRY_SID&quot;)),
      @AttributeOverride(name = &quot;code&quot;, column =
              @Column(name = &quot;COUNTRY_CODE&quot;)),
      @AttributeOverride(name = &quot;description&quot;, column =
              @Column(name = &quot;COUNTRY_DESCRIPTION&quot;))})
  public class Country extends AbstractCatalog {
  
      public static final int MAX_CODE_LENGTH = 11;
  
      @Column(name = &quot;GEONAMEID&quot;, nullable = true, unique = false)
      private Long geonameid;
  
      // getter and setter
  }
  </code></pre>
  <p>Has anyone any idea, how I could use only ONE repository for all the implementations of <code>AbstractCatalog</code> class without having to create the same interface over and over again with minimal differences in name and other properties?</p>