I\'m trying to define a method in a Spring Data repository to fetch the last records on a table ordered by date. This is my entity:
@Entity
public class News
Turns out that the signature of the method was incorrect. The right one is:
findFirst5ByOrderByPublicationDateDesc()
Is a little confusing because in the official samples they have this:
List findTop10ByLastname(String lastname, Pageable pageable);
As you can see there is only one By there, the usual one.