title: How to define reusable <generator> elements in hibernate mapping
body: <p>I have a Hibernate <code>hbm.xml</code> mapping file which defines a large number of class mappings. Each of these needs an <code>&lt;id&gt;</code> definition and a corresponding <code>&lt;generator&gt;</code> definition. </p>
  
  <p>In this particular application, the <code>&lt;generator&gt;</code> definition is quite involved, including setting a number of parameters (e.g. increment size, optimizer, etc). Having to repeat this definition for every class is tedious and clutters up the mapping.</p>
  
  <p>If I were using JPA annotations, I could define the ID generator at the package level. But I'm not using JPA (nor is it an option), and it seems most peculiar to be able to do something in JPA but not native hibernate.</p>
  
  <p>Can I specify the generator elsewhere, and refer to it multiple times in the mapping?</p>