title: How can I get the session object if I have the entity-manager?
body: <p>I have</p>
  <pre><code>private EntityManager em;
  
  public List getAll(DetachedCriteria detachedCriteria)   {
  
      return detachedCriteria.getExecutableCriteria(&quot;....&quot;).list();
  }
  </code></pre>
  <p>How can I retrieve the session if am using entitymanager, or how can I get the result from my detached criteria?</p>