I\'m trying to execute some SQL queries in my repository which extends CrudRepository. I have the following code in Controller:
@CrossOrigin(origins = \"*\"
You can change the DAO to below and this should work.
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();
}
Make sure the Bean class constructor should have the passing parameters.
Verify that the query is valid JPA query(here).