Spring Data - get last record from the table
You should use findTopByOrderByIdDesc()
This is called named query, you can check the documentation
There is no specific function to get the last record.
You can, however, order in reverse (DESC on ID, for example - assuming there's an ID) and get the first record.
EDIT: As per @MountainKing's suggestion in the comments below, you can use findTopByOrderByIdDesc()