title: JPA Repository: javax.persistence.NonUniqueResultException: result returns more than one elements
body: <p>Using the below code I am unable to get the results of my query.  Whether I use <code>Map&lt;ContentType...</code> or <code>Map&lt;String...</code> I get the same error: javax.persistence.NonUniqueResultException: result returns more than one elements</p>
  
  <p>It seems like JPA should be able to handle multiple rows in Repositories.  I've looked around for other annotations that I might just be missing and am having a hard time coming up with results.</p>
  
  <p>Any suggestions on what I should do to resolve this?</p>
  
  <pre><code>@Transactional
  public interface ContentRepository extends JpaRepository&lt;Content,Integer&gt;{
  
      ....
  
      @Query(nativeQuery=true, value="SELECT content_type, COUNT(*) AS myColumn FROM dbo.content GROUP BY content_type")
      Map&lt;ContentType, Integer&gt; getContentCountByType();
  
  }
  </code></pre>