title: How to use existing Oracle sequence to generate id in hibernate?
body: <p>I have legacy Oracle db with a sequence named <code>PRODUCT_ID_SEQ</code>. </p>
  
  <p>Here is the mapping of <code>Product</code> class for which I need generate correct ids:</p>
  
  <pre><code>public class Product {
     @GeneratedValue(strategy = GenerationType.SEQUENCE, 
                         generator = "retailerRaw_seq")
     @SequenceGenerator(name = "retailerRaw_seq", 
                        sequenceName = "PRODUCT_ID_SEQ")
     private Long id;
  
     ...
  }
  </code></pre>
  
  <p>But looks like ids are generated with an interval of 50, like 1000, 1050, 1100 etc. This corresponds to the default value of <code>allocationSize</code> property = 50. So that means that Hibernate doesn't actually use the sequence which is already defined in the db. </p>
  
  <p>How do I make Hibernate use the sequence?</p>