Java Spring JPA-查找方式和订购方式

Java Spring JPA-查找方式和订购方式,java,spring,spring-data-jpa,Java,Spring,Spring Data Jpa,我有一个竞赛实体: @Entity @Table(name = "T_CONTEST") public class Contest { //rest of the attributes @Column(name = "START_TIME") private LocalDateTime start; @Column @Enumerated(EnumType.STRING) private ContestStatus status; } 我

我有一个竞赛实体:

@Entity
@Table(name = "T_CONTEST")
public class Contest { 

    //rest of the attributes

    @Column(name = "START_TIME")
    private LocalDateTime start;

    @Column
    @Enumerated(EnumType.STRING)
    private ContestStatus status;
}
我想获得第一个比赛,最近的开始时间和状态=待定。 我知道这可以通过自定义查询来实现,但是正确的SpringJPA方法是什么呢? 我试着跟着,但不正确

Contest findTopByOrderByStartAndStatusDesc(ContestStatus status);
你试过了吗

findTopByContestStatusOrderByStartDesc(ContestStatus status)
?