title: Hibernate/JPA - annotating bean methods vs fields
body: <p>I have a simple question about usage of Hibernate.  I keep seeing people using JPA annotations in one of two ways by annotating the fields of a class and also by annotating the get method on the corresponding beans.</p>
  
  <p>My question is as follows: Is there a difference between annotating fields and bean methods with JPA annoations such as @Id.</p>
  
  <p>example:</p>
  
  <pre><code>@Entity
  public class User
  {
  
  **@ID**
  private int id;
  
  public int getId(){
  return this.id;
  }
  
  public void setId(int id){
  this.id=id;
  }
  
  }
  </code></pre>
  
  <p>-----------OR-----------</p>
  
  <pre><code>@Entity
  public class User
  {
  
  
  private int id;
  
  **@ID**
  public int getId(){
  return this.id;
  }
  
  public void setId(int id){
  this.id=id;
  }
  
  }
  </code></pre>