PSQLException: The column name clazz_ was not found in this ResultSet

后端 未结 2 1529
北海茫月
北海茫月 2021-01-27 15:03

I am trying to fetch a PlaceEntity. I\'ve previously stored a bunch of GooglePlaceEntity objects where



        
2条回答
  •  难免孤独
    2021-01-27 15:37

    You should use the name of the class instead of the table name on the query. Change place to PlaceEntity.

    @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) " + 
        ") < :radius",
        nativeQuery = true)
    List findNearby(@Param("latitude") Float latitude,
                                   @Param("longitude") Float longitude,
                                   @Param("radius") Integer radius);
    

提交回复
热议问题