API
http://localhost:8091/v1/Orders/$count
http://localhost:8091/v1/Orders?$count=true
Error:
{ "error": { "code": null, "message": "class java.lang.Integer cannot be cast to class java.lang.Long" } }
In MS SQL server, the return type of the count function is int.

JPAJoinQuery.java > CountResults() method will be called in case of /orders/$count or /orders?$count=true.
This calls getSingleResult() (line no: 104). So, expected return type is Long.

TypeQueryImpl.java > getSingleResult() calls getResultList()(line no: 185), which returns List instead of List<Long)

because the select count() query returns List.

Can you please help or guide here.