title: hibernate Autoincrement not set in the database
body: <p>I know that this question has been asked many times but the answers are not perfect.</p>
  <p>I would like to set a primary key column with Auto-Increment. Once I create the database, the column is there but AI is not set.</p>
  <p>This is a sample code for auto increment</p>
  <pre><code>public class ProjectEntity {
      private int id;
      private String name;
  
      @Id
      @Column(name = &quot;ID&quot;)
      @GeneratedValue(strategy = GenerationType.AUTO)
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      @Basic
      @Column(name = &quot;Name&quot;)
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  <p>The other problem, is the columns ordering in the database are not the same as the POJO class.</p>
  <p>class book{
  int ISBN;
  String title;
  String Author;
  String Lang;
  int nbPages;
  }</p>
  <p>In the database, I get: ISBN, LANG, Author, title</p>