title: Can I use subclass properties in Hibernate Criterion Example?
body: <p>I have a class-hierarchy:</p>
  
  <pre><code>Company &lt;---- Customer
  ------        --------
  string id     bool prospect
  string name
  </code></pre>
  
  <p>Basically everything works fine (save and load).</p>
  
  <p>What fails is this: I want to query all Customers which have prospect==true.</p>
  
  <p>But, it seems like Hibernate is ignoring the prospect property of the subclass.
  I'm creating a Customer object and set prospect=true , then I'm using this code</p>
  
  <p><code>Example example = Example.create(exampleCustomerInstance);</code></p>
  
  <p>When I look at the query (debug output) I see that there's no WHERE statement for prospect that's why all Customers are returned and not only those with prospect=true</p>
  
  <p>As a workaround I've pulled up the prospect to the Company and now it works ... so my question:</p>
  
  <p><strong>is it impossible with Hibernate to query such subclass properties (if yes, why?)?</strong></p>
  
  <p>(I'm using Hibernate 3.6.)</p>