您可以将DAO更改为下面,这应该可以工作。
public interface UserRequestResponseRepository extends CrudRepository<UserRequestResponse, Integer> {public static final String FIND_QUERY = "select new com.abc.datacollection.entity.UserRequestResponse(user.u_httpstatus ,user.u_queryparam, COUNT(user.u_type)) from UserRequestResponse user GROUP BY user.u_type";@Query(value = FIND_QUERY)//public List<UserProjection> getAllRequestResponseRecords(); List<UserProjection> findAllProjectedBy();}
确保Bean类构造函数应具有传递的参数。
验证查询是否为有效的JPA查询(此处)。



