@Repository
public interface XYZRepository extends R2dbcRepository<XYZ, XYZPK> {
@Query(value = "select * from xyz\n" +
"right join (select max(capture_date) capture_date from xyz) as t using (capture_date)\n" +
"where id = :id", nativeQuery = true)
Flux<XYZ> getLatestById(@Param("id") String id);
}
I was expecting it to return just latest from database but it returning all entries by id and I tried renaming it to "getLatestXYZ" then getting error "No property 'getLatestXYZ' found for type 'XYZ'"