i have a table
Permission:
what i am doing right now is to make a query that returns a p
In JPA 2.0 (which recent versions of Hibernate support), you can map collections of primitives using an @ElementCollection
annotation.
For some samples of such mappings see the hibernate collections docs.
If you're not actually mapping it in this way but want to create a map using either HQL or a Criteria query, you can create a ResultTransformer to create a map from the returned result set.
Judging from Xavi's answer, I guess there is also support in HQL for creating a map without using a transformer.