title: How to use a custom SequenceGenerator for Hibernate in Spring for all entities?
body: <p>I've implemented a custom <code>SequenceGenerator</code> that I want to use in all my entities for the "id". But rather than having to do something like <a href="https://stackoverflow.com/a/11632114/398441">this</a> for <em>each</em> entity:</p>
  
  <pre><code>@Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "XyzIdGenerator")
  @GenericGenerator(name = "XyzIdGenerator",
          strategy = "com.mycompany.myapp.id.BigIntegerSequenceGenerator",
          parameters = {
              @Parameter(name = "sequence", value = "xyz_id_sequence")
          })
  public BigInteger getId()
  {
     return id;
  }
  </code></pre>
  
  <p>is there a way to apply this <code>SequenceGenerator</code> to ALL entities by default using vanilla Hibernate/JPA or perhaps by using Spring?</p>