title: Hiibernate: @OrderColumn in @OneToMany causes an UPDATE after INSERT
body: <p>I have the following POJOs for my db schema.</p>
  
  <pre><code>@Entity
  @Table(name = "Quotes")
  public class QuoteRequest
  {
      public QuoteRequest(){}
  
      @Id
      @Column(name = "quote_request_id")
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long QuoteRequestId;
  
  
      @OneToMany(mappedBy = "quoteRequest", cascade = CascadeType.ALL)
      @OrderColumn(name = "accidents_id")
      private Accidents[] accidents;
  
      // Getters and setters
  }
  
  @Entity
  @Table(name = "Accidents")
  public class Accidents
  {
      public Accidents()
      {
      }
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "accidents_id")
      private long AccidentId;
  
  
      @Column(name = "amount", nullable = false)
      private Float amount;
  
      @ManyToOne(optional = false, cascade = CascadeType.ALL)
      @JoinColumn(name = "quote_request_id", nullable = false)
      private QuoteRequest quoteRequest;
  
      // Getters and setters
  }
  </code></pre>
  
  <p>Because I'm using an array to store <code>Accidents[]</code> Hibernate is requiring me to add <code>@OrderColumn</code>. Adding this causes an update to be generated after insert that zeros out my <code>accidents_id</code>. The only way I found around that is to change Accidents[] to Set. </p>
  
  <p>How can I keep Accidentsas an array and not have Hibernate force this 2nd update after the insert?</p>