title: Hibernate: How to get result from query with multiple classes
body: <p>If my query contains one class, like: </p>
  
  <pre><code>query = session.createQuery("select u from User as u");
  queryResult = query.list();
  </code></pre>
  
  <p>then I iterate it, where <code>queryResult</code> is an object of <code>User</code> class.</p>
  
  <p>So how to get result from query which contains more than one class? For example: </p>
  
  <pre><code>select u, g from User as u, Group as g where u.groupId = g.groupId and g.groupId = 1
  </code></pre>