title: HQL query for multiple types/classes
body: <p>I have a complex class hierarchy with multiple levels of inheritance, and I need to query for certain specific types within that hierarchy, using HQL.</p>
  
  <p>Let's say I have classes Cat, Dog and Monkey, with a common base-class Animal.</p>
  
  <p>How do I write a query that selects only some of those, let's say, Cat and Dog?</p>
  
  <p>I also need to sort or filter by certain Animal properties - so let's say, animals with Sex="Male" and order by Name.</p>
  
  <p>Is this possible?</p>