# Cannot create TypedQuery for query with more than one return using requested result type ###### tags: `TypedQuery` `JPQL` `JPA` `EntityManager` ```java package club.live173.dto; public class LiuLanQi { private String userAgent; private long howMany; public LiuLanQi() { } public LiuLanQi(String userAgent, long howMany) { this.userAgent = userAgent; this.howMany = howMany; } public String getUserAgent() { return userAgent; } public void setUserAgent(String userAgent) { this.userAgent = userAgent; } public long getHowMany() { return howMany; } public void setHowMany(long howMany) { this.howMany = howMany; } } ``` ```java TypedQuery<LiuLanQi> typedQuery = entityManager.createQuery( "SELECT NEW com.herokuapp.live173.dto.LiuLanQi(aeh.headerValue,COUNT(aeh.headerValue)) FROM AccessEventHeader aeh GROUP BY aeh.headerValue ORDER BY COUNT(aeh.headerValue),aeh.headerValue", LiuLanQi.class ); return typedQuery.getResultList(); ``` https://stackoverflow.com/questions/16787529/jpa-typedquery-error