Generic « Load « JPA Q&A

1. using load/get using generics

With Hibernate, how do I load an entity using generics? Curretly I am doing:

Entity e = (Entity) session.load(Entity.class, 123);
In NHibernate, with generics, I can do:
What's the Hibernate equivalent?

2. hibernate, mix load with criteria possible?

is it possible to mix a session.load(class, id) with a flexible criteria (criteria api)? I need something like :

select * from entity where id = 1 AND name = 'miller'
I use the ...

3. Generic HSL to load ID and Name into a Map

Hibernate version:3.1 This probably is a silly/simple question. Is there an easy generic way of loading only 2 pieces of information out of mapped classes/tables without having to create special class mappings. Typical use for almost all objects would be to simply select the Database ID, and Name suitable for display in a list so that a user can choose an ...

4. Not using generics ? (Session.load() ...)