title: No identifier specified for entity Spring boot
body: <p>I am writing sample program in Spring boot with Hibernate . I am getting the following error:</p>
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.example.demo.model.CheckRes
  ...
  Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.example.demo.model.CheckRes
  ...
  </code></pre>
  <p>I have specified identity column as well.</p>
  <p><strong>CheckRepository.java</strong></p>
  <pre><code>package com.example.demo.repository;
  
  import com.example.demo.model.CheckRes;
  import org.springframework.data.jpa.repository.JpaRepository;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public interface CheckRepository extends JpaRepository&lt;CheckRes,Long&gt; {
  }
  </code></pre>
  <p>What else is missing in Model according to the error?</p>
  <p>Edit1:
  I added the getter and setter to the model but still the same error:</p>
  <pre><code>package com.example.demo.model;
  import org.springframework.data.annotation.Id;
  import javax.persistence.*;
  
  @Entity
  @Table(name=&quot;CheckRes&quot;)
  public class CheckRes {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long ID;
  
      @Column(name=&quot;Check&quot;)
      private String Check;
  
      public CheckRes() {
      }
  
      public CheckRes(String check) {
          Check = check;
      }
  
      public long getID() {
          return ID;
      }
  
      public void setID(long ID) {
          this.ID = ID;
      }
  
      public String getCheck() {
          return Check;
      }
  
      public void setCheck(String check) {
          Check = check;
      }
  }
  </code></pre>