The column name id was not found in this ResultSet

Viewed 983
@Query(value = "SELECT s FROM logines.work_hour s WHERE TO_TIMESTAMP(s.start_time,  'YYYY-MM-DD HH24:mi')\\:\\:timestamp BETWEEN :start_time\\:\\:timestamp AND now()\\:\\:timestamp", nativeQuery = true)
List<WorkHour> findByStartTime(@Param("start_time") String startTime);

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

What might be an issue?

1 Answers

The issue could be due to the usage of only s in @Query. replacing s with all db column names with it i.e., s.coloumn1, s.column2, s.column3 will fix the issue.

Related