Which version of EJB do you use? For EJB3, you can get the EntityManager injected. For earlier versions, you can lookup the SessionFactory object and then get the Session from the session factory. More details can be found in the Hibernate Reference at http://www.hibernate.org/hib_docs/reference/en/html/index.html especially Chapter 3
Sorry for the delay. We're using EJB3 and we have the EntityManager injected. I don't see methods in EntityManager that allow us to get a handle on the Hiberhate SessionFactory - am I missing something?
What we're really trying to do is use a Criteria to filter our query results from the database. Following that down, we can eventually do a getCriteria...
I'm after a similar feature, so I can use the Hibernate session to detache the objects...