title: JPQL: determine sub class type from super class join?
body: <p>My question is very similar to this one:</p>
  
  <p><a href="https://stackoverflow.com/questions/6556937/how-can-i-write-a-hibernate-criteria-query-for-a-super-class-and-check-for-a-ce">How can I write a Hibernate Criteria query, for a super-class, and check for a certain sub-class?</a></p>
  
  <p>..., except for one thing:</p>
  
  <ul>
  <li>I'm using a JPQL query instead of the Hibernate Criteria API (still Hibernate as a JPA provider though)</li>
  </ul>
  
  <p>I'm referencing a super table/entity class (Round) which has two sub tables/entity classes (RankingRound and EliminationRound). I then create a JOIN:</p>
  
  <pre><code>SELECT
    ...
    ??? AS is_ranking_round
    ...
  FROM Group gr
    JOIN gr.round rd
    ...
  WHERE
  </code></pre>
  
  <p>Is there a way to find out the round type of the rd instance like the above in JPQL? (I don't seem to be able to translate the criterion to anything that works in JPQL.)</p>