title: HQL right outer join
body: <p>I am trying to perform right outer join in HQL. Query creation is done as mentioned below:</p>
  
  <pre><code>Query query = this.sessionFactory
              .getCurrentSession()
              .createQuery(
  "select 
         O.customer.id as id, 
         O.customer.firstName as firstName, 
         O.customer.lastName as lastName, 
         O.customer.address as address, 
         O.customer.city as city, 
         count(O.id) as totalOrders 
   from 
         Order O 
         right outer join O.customer 
   group by 
         O.customer.id");
  </code></pre>
  
  <p>SQL query on mysql is working fine, but the HQL query is returning the result for inner join.</p>
  
  <p>SQL query is:</p>
  
  <pre><code>select c.id,
      c.firstname,
      c.lastname,
      c.city,
      count(o.id) as total_order
    from orders o right outer join customers c
    on c.id = o.customer_id group by id
  </code></pre>