title: How to combine annotations for hibernate mapping?
body: <p>Assuming that (using <a href="https://en.wikibooks.org/wiki/Java_Persistence/What_is_JPA%3F" rel="nofollow noreferrer">JPA</a>) I have an entity with an id:</p>
  
  <pre><code>...
  @Id
  @TableGenerator(name = "EVENT_GEN",
                  table = "SEQUENCES",
                  pkColumnName = "SEQ_NAME",
                  valueColumnName = "SEQ_NUMBER",
                  pkColumnValue = "ID_SEQUENCE",
                  allocationSize=1)
  private Long id;
  ...
  </code></pre>
  
  <p>how can I declare a custom annotation so the above id mapping will be :</p>
  
  <pre><code>@CustomIdAnnotation
  private Long id
  </code></pre>
  
  <p>May be something like this <a href="https://stackoverflow.com/a/13408807/2114786">SO answer</a>. </p>