out-of-the-box way to get an idmap from hibernate for a given entity?
- by Geert-Jan
Over and over again I notive myself getting a list from hibernate, and the first thing next is put it in an idmap
like:
List<House> entities = s.createCriteria(House.class).list();
Map<String,House> entitymap = new HashMap<String,House>();
for(TA_entity e:entities){
entitymap.put(e.getId(), e);
}
Is there a way to get this directly out of hibenerate? afterall Hibernate is familiar with the id.