如何将OrderBy与GreaterThan Spring JPA一起使用

Alb*_*spo 7 java spring jpa repository

我想在我的Repository接口中添加一个方法,该方法可以查找大于long publishdata值的所有数据并按顺序对其进行排序:

我尝试过这个,但它似乎没有起作用:

@Repository
public interface NoticiaRepository extends CrudRepository<Noticia,Long>{

    Noticia findById(long id);
    List<Noticia> findByOrderPublishdateGreaterThanDesc(long publishdate);

}
Run Code Online (Sandbox Code Playgroud)

mar*_*rok 17

List<Noticia> findByPublishdateGreaterThanOrderByPublishdateDesc(Long publishdate)
Run Code Online (Sandbox Code Playgroud)