Reputation: 185
I have a problem. how can i return map as query in jpa ?
Map<string, User> userMap = em.createQuery("select new map(u.id, *)
from user u"
I want to return map as query but I don't know how to.
and I don`t want to return map using to iterate list. like as the below
How to return HashMap from JPA query?
can someone help me ?
in advance thank you.
Upvotes: 1
Views: 3048
Reputation: 112
You have to make a map list at least, which means list cannot be mapped to single map.
Upvotes: 1