title: createNativeQuery mapping to POJO (non-entity)
body: <p>I have an easy problem at the first glance:</p>
  
  <pre><code>entityManager()
  .createNativeQuery("select count(*) as total, select sum(field) as total_sum ... blabla") 
  </code></pre>
  
  <p>And I want to write select result into POJO, like this:</p>
  
  <pre><code>public class AggregateStatsDto {
  
      private int total;
  
      private long totalSum;
  
      // getters, setters, cosntructors
  }
  </code></pre>
  
  <p>What the best way to achieve this?</p>
  
  <p>I can use JPA 2.1 and tried to use <em>@SqlResultSetMapping</em> in conjuction with <em>@ConstructorResult</em>:</p>
  
  <pre><code>@SqlResultSetMapping(name = "AggregateStatsResult", classes = {
          @ConstructorResult(targetClass = AggregateStatsDto.class,
                  columns = {
                          @ColumnResult(name = "total"),
                          @ColumnResult(name = "totalSum")
                  })
  })
  public class AggregateStatsDto {
  
          private long total;
  
          private int totalSum;
  
          // getters, setters, cosntructors
      }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>AggregateStatsDto result = (AggregateStatsDto) entityManager()
      .createNativeQuery("select count(*) as total, select sum(field) as total_sum ... blabla", "AggregateStatsResult")
      .getSingleResult();
  </code></pre>
  
  <p>But no luck. It seems that it wants @Entity anyway. But I want just a POJO.</p>
  
  <pre><code>org.hibernate.MappingException: Unknown SqlResultSetMapping [AggregateStatsResult]"
  </code></pre>
  
  <p>Thanks in advance!</p>