title: Spring Data The return type is an abstract class or interface error
body: <p>I have a stupid question. I don't understand why my Spring Data Repository method using Projections produces this compilation error.</p>
  
  <p>I have a repository class</p>
  
  <pre><code>@Repository
  public interface MyClassRepository extends JpaRepository&lt;MyClass, Long&gt; {
    Page&lt;MyProjection&gt; getResultsByParam(@Param("param") Long personId,
                                                   Pageable pageable, Sort sort);
  }
  </code></pre>
  
  <p>and the Projection (I have a large hibernate connected object, from which I want only a few fields)</p>
  
  <pre><code>public interface MyProjection {
    Type getType();
  
    Status getStatus();
  
    SubItem getDocument();
  
    interface SubItem {
      String getName();
    }
  }
  </code></pre>
  
  <p>When I try to call the method from a service I get </p>
  
  <pre><code>error: The return type is an abstract class or interface. Provide a non abstract / non interface result type or a factory method.
  </code></pre>
  
  <p>I call the Service like this, where the compilation error is.</p>
  
  <pre><code>myClass.getResultsByParam(param, page, sort)
  </code></pre>
  
  <p>I am quite sure that, I have something really simple wrong here...</p>