title: Hibernate, return custom object with Criteria or HQL
body: <p>there is a way to return a custom object with a criteria query or hql query?</p>
  
  <p>For example, i have a class MyClass with a constructor MyClass(int id, String text), i want incapsulate my queries result in this class:</p>
  
  <pre><code>"select new MyClass(e.id, e.name) from Example e"
  </code></pre>
  
  <p>MyClass is not an entity, but a simple custom class.</p>
  
  <p>Thank all.</p>