title: How to use a spring bean as a custom ID generator
body: <p>I want to specify a custom id generator for an entity in a spring data jpa project.</p>
  
  <p>I know that I can use something like:</p>
  
  <pre><code>@Id
  @GenericGenerator(name = "id_generator", strategy = "com.example.generator.CustomIdGenerator")
  @GeneratedValue(generator = "id_generator")  
  </code></pre>
  
  <p>What I'm wondering is whether it's possible to somehow wire a spring bean as the strategy rather than a concrete class.</p>
  
  <p>E. g. </p>
  
  <pre><code>@Id
  @GenericGenerator(name = "id_generator", strategy = "bean", bean="beanName")
  @GeneratedValue(generator = "id_generator")  
  </code></pre>