title: Is there any reason to not generate setters and getters for @Id fields in JPA?
body: <p>Assuming a JPA entity with (for example) an long id generated automatically:</p>
  
  <pre><code>@Entity
  @AutoProperty
  public class SomeItem {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)   
      private long Id;
  
      ...
  
  }
  </code></pre>
  
  <p>Is there any reason to not generate setter and getters for this Id? One might be tempted to not generate a setter for example, since it is the responsibility of JPA to generate the ID.</p>