Say I have an entity called Employee with a String persistent field called "id". Now say by using a JPQL query I only wish to project the id of a particular employee. What will be the return type of that query ? List<Object> or String ? I am confused since I heard that project queries returns only List<Object> but in this case it makes more sense to return only a String object.
Also how would I write such a query ?
Would the above query work ?
Also what would be the return type of aggregate functions like COUNT or SUM ? Single integer or list of Objects ?