title: Bound mismatch for java generics for a spring app
body: <p>I am trying to create a REST api using Spring MVC. Instead of writing CRUD methods for each of the controller, I created an abstract class that would take care of the typical REST CRUD scenarios. So I created these following classes</p>
  
  <pre><code>public interface DomainObject&lt;ID extends Serializable&gt; {}
  
  public class Apps implements DomainObject&lt;String&gt;{}
  
  public interface AppsRepository extends PagingAndSortingRepository&lt;Apps, String&gt; {}
  
  public abstract class AbstractController&lt;T extends PagingAndSortingRepository&lt;DomainObject&lt;Serializable&gt;, Serializable&gt;&gt; {}
  </code></pre>
  
  <p>With the above class/interface definitions, how do I declare a class that extends the AbstractController?</p>
  
  <p>I tried declaring AppsController using</p>
  
  <pre><code>public class AppsController extends AbstractController&lt;AppsRepository&gt;{}
  </code></pre>
  
  <p>without any luck. Eclipse is showing the following error</p>
  
  <pre><code>Bound mismatch: The type AppsRepository is not a valid substitute for the bounded parameter &lt;T extends PagingAndSortingRepository&lt;DomainObject&lt;Serializable&gt;,Serializable&gt;&gt; of the type AbstractController&lt;T&gt;
  </code></pre>
  
  <p>I am totally stuck. I have tried different approches for a while without any luck. Any help would be greatly appreciated. </p>