In JPQL, I can retrieve entities by :
query = entityManager.createQuery(\"select c from Category c\"); List categories = query.getResultList(
It is not the use of the .list() function itself which makes the result a List. It is the specification of fields (c.id, c.name) in the HQL query. If your query is
.list()
List
c.id, c.name
"select c from Category c"
Then query.list() will return a List object.
query.list()