title: Get last records ordered by date on Spring Data
body: <p>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:</p>
  
  <pre><code>@Entity
  public class News {
  
      @Id
      @GeneratedValue
      private Long id;
  
      @Column(nullable = false)
      private String title;
  
      @Column(nullable = false)
      private String text;
  
      private Date publicationDate;
  
      /* Getters and Setters */
  }
  </code></pre>
  
  <p>And this is my repository:</p>
  
  <pre><code>public interface NewsRepository extends JpaRepository&lt;News, Long&gt; {
      List&lt;News&gt; findFirst5OrderByPublicationDateDesc();
  }
  </code></pre>
  
  <p>If I try to use launch the project I get the next error:</p>
  
  <blockquote>
    <p>Caused by:
    org.springframework.data.mapping.PropertyReferenceException: No
    property desc found for type Date! Traversed path: News.publicationDate.</p>
  </blockquote>
  
  <p>And if I remove the Desc I get this:</p>
  
  <blockquote>
    <p>Caused by: java.util.NoSuchElementException</p>
  </blockquote>
  
  <p>What I'm doing wrong?</p>