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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -