title: How to inject a spring's service bean into a JPA Entity?
body: <p>My problem is very similar to this one : <a href="https://stackoverflow.com/questions/3505421/injecting-fields-via-spring-into-entities-loaded-by-hibernate">Injecting fields via Spring into entities loaded by Hibernate</a></p>
  
  <p>The difference is that , I am using JPA2 entities , not hibernate . While the underlayer is still hibernate (3.5.5).</p>
  
  <p>My spring version is 3.0.4.</p>
  
  <p>What's the corresponding <code>eventListeners</code> in JPA's world ?</p>
  
  <p>Sample code from the original post :</p>
  
  <pre><code>class Student {
     int id; //loaded from DB
     String name; //loaded from DB
     int injectedProperty; //Inject via Spring
     transient Service serviceImpl; //Inject via Spring
  }
  </code></pre>
  
  <p>I know there may be aspectJ's solutions , but I'd rather like a pure-java solution. 
  Thanks.</p>