title: How to select an object's class in Hibernate HQL?
body: <p>How can I select an object's class in HQL? When I do the following:</p>
  <pre><code>select e.class, e.name from Entity e
  </code></pre>
  <p>Hibernate returns an Integer (e.g. [12, &quot;name&quot;]) instead of a class object. How can I return a Java class, or at least the class or entity name? Or, if this is not possible, how can I convert the 12 to a Java class?</p>
  <p>For performance reasons, I can't query the full objects, i.e. I can't do</p>
  <pre><code>select e from Entity
  </code></pre>
  <p>Regards,
  Jochen</p>