title: Criteria query returns child objects rather parent object that was requested
body: <p>I have a problem with a hibernate criteria query. I have:</p>
  
  <pre><code>DetachedCriteria carCriteria = DetachedCriteria.forClass(Car.class);
  List&lt;Car&gt; cars = getHibernateTemplate().findByCriteria(carCriteria);
  
  for(Car car : cars) {
  System.out.println("class type " + car.getClass());
  }
  </code></pre>
  
  <p>The above prints class type model.FourByFour where FourByFour extends Car. As I have specified the Car class in the DetachedCriteria, I was expecting the class type to be Car and not FourByFour.</p>
  
  <p>Mapping (simplified):</p>
  
  <pre><code>&lt;hibernate-mapping default-access="field" default-lazy="true" package="model"&gt;
  &lt;class name="model.Vehicle" table="VEHICLE"&gt;
  &lt;id column="VEHICLE_ID" name="id" type="long"&gt;
      &lt;generator class="native" /&gt;
  &lt;/id&gt;
  
      ...
  
      &lt;joined-subclass extends="model.Vehicle" name="model.Car" table="CAR"&gt;
      &lt;key column="VEHICLE_ID" /&gt;
          ....
          &lt;joined-subclass extends="model.Car" name="model.FourByFour" table="FOUR_BY_FOUR"&gt;
      &lt;key column="VEHICLE_ID" /&gt;
      &lt;/joined-subclass&gt;
  &lt;/joined-subclass&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>How can I make the object returned from the criteria query be a Car object and not the FourByFour object?</p>