title: How to flatten the results of a Hibernate query
body: <p>Say I executed a theoretical HQL query like <code>FROM Customer</code>.  And in <code>Customer</code> is a <code>getOrders()</code> getter returning a ManyToOne collection of <code>Order</code> objects.  This executes a SQL statement selecting from Customer with a left join to Order.</p>
  
  <p>Through the object model, I can programmaticly iterate over Customers and then iterate over Orders.</p>
  
  <p>However, I want to convert the hierarchical object model to a flat tabular result of the left join so that the results would look much like that of this SQL query:</p>
  
  <pre><code>SELECT *
  FROM Customer
  LEFT JOIN Order on Customer.customerId = Order.customerId
  </code></pre>
  
  <p>Sample result:</p>
  
  <pre><code>Customer.customerId  ... Order.orderId  Order.customerId ...
  1                        200            1
  2                        201            2
  2                        202            2
  3                        NULL           NULL
  </code></pre>
  
  <p>Is there an easy way to do this with Hibernate?</p>