java - Hibernate : Resultset mapping in to Map<EntityTypeId,List<EntitiyIds>> -


we have table contains data below

 id  entity_type_id  entity_id 1          1          1234 2          1          2356 3          1          7896 4          1          4321 5          2          1234 6          2          9876 7          2          5289 8          2          4568 

and wrote query follow data. how can modify query return list of entitiyids value , entitytypeid key.

<query name="getallentities"> <![cdata[     select e.entity_type_id, e.entity_id entity e ]]> </query> 

something below

<query name="getallentities"> <![cdata[     select new map(e.entity_type_id et_id, e.entity_id e_id) entity e ]]> </query> 

refer this more details


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -