title: @Id annotation in JPA and Hibernate
body: <p>If I don't want to automatically generate the primary Key, instead, I want to supply the ID with the first column of the table as primary key.</p>
  
  <pre><code>2 A
  4 B
  7 D
  13 E
  </code></pre>
  
  <p>...</p>
  
  <p>I want the first column 2,4, 7, 13 to be the primary key of the table. Should I just use @Id to do the annotation? </p>
  
  <pre><code>@Entity
  public class Code {
     @Id
     @Column(unique=true)
     private int id;
  
     ...
  }
  </code></pre>
  
  <p>Or, if @Id is used, the primary key will be always automatically generated, instead of using the first column, in this case?</p>