title: Spring Data JPA "null value in column xxx violates not-null constraint" on serial column with postgresql
body: <p>My entity has a mapOrder field which I want auto-increment like below:</p>
  
  <pre><code>@Entity
  public class Map{
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @Column(columnDefinition = "serial")
      private Long mapOrder;
  
      //.......
  }
  </code></pre>
  
  <p>The sql generated seems good:</p>
  
  <pre><code>CREATE TABLE map
  (
    id bigserial NOT NULL,
    map_order serial NOT NULL,
    ...
  )
  </code></pre>
  
  <p>But when I save it with Spring Data JPA's repository, like this:</p>
  
  <pre><code>Map m=new Map();
  repo.save(m);
  </code></pre>
  
  <p>will give me exception:</p>
  
  <pre><code>Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "map_order" violates not-null constraint
  </code></pre>
  
  <p>Any ideas?</p>