How to use OrderBy with GreaterThan Spring JPA

34,379
List<Noticia> findByPublishdateGreaterThanOrderByPublishdateDesc(Long publishdate)
Share:
34,379

Related videos on Youtube

Alberto Crespo
Author by

Alberto Crespo

Software Engineer. Services as a Freelance, contact me: [email protected]

Updated on July 09, 2022

Comments

  • Alberto Crespo
    Alberto Crespo almost 2 years

    I want to add in my Repository interface a method which find all the data greater than a long publishdata value and Order it Decreacingly:

    I tried this, but it doesn't seems to be working:

    @Repository
    public interface NoticiaRepository extends CrudRepository<Noticia,Long>{
    
        Noticia findById(long id);
        List<Noticia> findByOrderPublishdateGreaterThanDesc(long publishdate);
    
    }
    
  • marok
    marok about 5 years