title: JPA: The column name DTYPE was not found in this ResultSet
body: <p>In my Spring application I have an entity called Resource::</p>
  
  <pre><code>@Entity
  public class Resource {
  
  List&lt;Resource&gt; list = em.createNativeQuery("select r.* from ...", Resource.class).getResultList();
  </code></pre>
  
  <p>For one specific purpose, I need a few more fields to be added to the results. So I created a subclass ExtendedResource:</p>
  
  <pre><code>@Entity
  public class AreaResource extends Resource {
      @Column(name="extra_field")
      private Integer extra field;
  
  List&lt;ExtendedResource&gt; list = em.createNativeQuery("select extra_field, r.* from ...", ExtendedResource.class).getResultList();
  </code></pre>
  
  <p>This works fine when I query for ExtendedResource, but for Resource I get:</p>
  
  <pre><code>org.postgresql.util.PSQLException: The column name DTYPE was not found in this ResultSet.
  </code></pre>
  
  <p>Is there any way around this, without bothering with a discriminator column? I guess <code>MappedSuperclass</code> is a solution, but I would like to avoid making extra classes.</p>
  
  <p>Thanks </p>