1

when i select 4 column an error occur :

Caused by: org.postgresql.util.PSQLException: The column name id was not found in this ResultSet.

@Query(value = "select name,rating,numberofviews,status from learningunit", nativeQuery = true)
List<Learningunit> findAllData();

then i add id to the query and the same error occur with different column and so on

@Query(value = "select id,name,rating,numberofviews,status from learningunit", nativeQuery = true)
List<Learningunit> findAllData();

Caused by: org.postgresql.util.PSQLException: The column name summary was not found in this ResultSet.

notes:i using jhipster and ever entity has a dto and mapper

entity Sample Image 1

DTO Sample Image 2 Mapper Sample Image 3

Karan Kalsi
  • 789
  • 3
  • 21
Mikhail Fayez
  • 421
  • 3
  • 15

1 Answers1

1

finally i solved the problem using this query @Query(value = "select null as id , name,rating,numberofviews,null as status from learningunit", nativeQuery = true)

the point is to select null as the name of your column

Mikhail Fayez
  • 421
  • 3
  • 15