title: How to create PostgreSql sequence with JPA?
body: <p>My target is that EJB should generate a sequence as it generates tables from Entities. How can I do that? </p>
  
  <p>I thought about this, but in that case I only use an existing sequence. I'd like a sequence to be generated by JPA. I think this isn't possible, or is it?</p>
  
  <pre><code>@Entity
  @Table(name = "CUSTOMER")
  @SequenceGenerator(name = "sb_sequence",sequenceName = "sb_sequence", initialValue=5420)
  public class Customer extends EntityBase
  {
      private static final long serialVersionUID = 3456353535358L;
  
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="sb_sequence")
      @Column(name = "CUS_SEQUENCE")
      private long cusSequence;
  .
  .
  .
  }
  </code></pre>
  
  <p>Background: Before I insert the first value into database, I need to retrieve the first sequence number (probably with select nextval('sequence');  )</p>