title: PSQLException: The column name clazz_ was not found in this ResultSet
body: <p>I am trying to fetch a <code>PlaceEntity</code>. I've previously stored a bunch of <code>GooglePlaceEntity</code> objects where</p>
  
  <pre class="lang-java prettyprint-override"><code>@Entity
  @Table(name = "place")
  @Inheritance(
          strategy = InheritanceType.JOINED
  )
  public class PlaceEntity extends AbstractTimestampEntity {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Entity
  @Table(name = "google_place")
  public class GooglePlaceEntity extends PlaceEntity {
      // Additional fields ..
  }
  </code></pre>
  
  <hr>
  
  <p>However, neither do I want to send information stored in <code>google_place</code> nor do I want to load it unnecessarily. For this reason I am only fetching</p>
  
  <pre class="lang-java prettyprint-override"><code>public interface PlaceRepository extends JpaRepository&lt;PlaceEntity, Long&gt; {
  
      @Query(value = "" +
              "SELECT * " +
              "FROM place " +
              "WHERE earth_distance( " +
              "   ll_to_earth(place.latitude, place.longitude), " +
              "   ll_to_earth(:latitude, :longitude) " + 
              ") &lt; :radius",
              nativeQuery = true)
      List&lt;PlaceEntity&gt; findNearby(@Param("latitude") Float latitude,
                                   @Param("longitude") Float longitude,
                                   @Param("radius") Integer radius);
  
  }
  </code></pre>
  
  <p>and what I get is this:</p>
  
  <pre class="lang-none prettyprint-override"><code>org.postgresql.util.PSQLException: The column name clazz_ was not found in this ResultSet.
      at org.postgresql.jdbc.PgResultSet.findColumn(PgResultSet.java:2588) ~[postgresql-9.4.1208-jdbc42-atlassian-hosted.jar:9.4.1208]
      at org.postgresql.jdbc.PgResultSet.getInt(PgResultSet.java:2481) ~[postgresql-9.4.1208-jdbc42-atlassian-hosted.jar:9.4.1208]
      at com.zaxxer.hikari.pool.HikariProxyResultSet.getInt(HikariProxyResultSet.java) ~[HikariCP-2.7.8.jar:na]
      at org.hibernate.type.descriptor.sql.IntegerTypeDescriptor$2.doExtract(IntegerTypeDescriptor.java:62) ~[hibernate-core-5.2.14.Final.jar:5.2.14.Final]
      at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:47) ~[hibernate-core-5.2.14.Final.jar:5.2.14.Final]
      ...
  </code></pre>
  
  <p>I am able to run this statement in pure PostgreSQL:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM place WHERE 
  earth_distance( 
    ll_to_earth(place.latitude, place.longitude), 
    ll_to_earth(17.2592522, 25.0632745)
  ) &lt; 1500;
  </code></pre>
  
  <p>but not using the <code>JpaRepository</code>.</p>
  
  <p>And by the way, fetching a <code>GooglePlaceEntity</code> is working however:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Query(value = "" +
          "SELECT * " +
          "FROM place JOIN google_place ON google_place.id = place.id " +
          "WHERE earth_distance( " +
          "   ll_to_earth(place.latitude, place.longitude), " +
          "   ll_to_earth(:latitude, :longitude) " + 
          ") &lt; :radius",
          nativeQuery = true)
  List&lt;GooglePlaceEntity&gt; findNearby(@Param("latitude") Float latitude,
                                     @Param("longitude") Float longitude,
                                     @Param("radius") Integer radius);
  </code></pre>