java - how do i pass EntityManager to @PostUpdate -
I want to save the history of changes, so in @PostUpdate, I want to create a new example of another entity and save it Is that how can I pass that unit to EntityManager?
You can get an example of this EntityManager as you would on any other:
1) Through injection in your classroom:
@ParisCenceTextX Entitemanager; // Inject your class 2) using EntityManagerFactory:
EntityManager em = EntityManagerFactory.getEntityManager ();
Comments
Post a Comment