Spring Data – get last record from the table [duplicate] September 5, 2023 by Tarik You should use findTopByOrderByIdDesc() This is called named query, you can check the documentation