Package cz.cvut.kbss.jopa.plugin
Interface PersistenceUnitLifecyclePlugin
public interface PersistenceUnitLifecyclePlugin
Interface to be implemented by JOPA lifecycle plugins.
The plugins may implement only selected methods, as they all by default do nothing.
Implementations must provide a public no-args constructor.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Invoked after the persistence unit has been created.default void
Invoked before the persistence unit is destroyed (typically on application shutdown).
-
Method Details
-
afterPersistenceUnitCreated
Invoked after the persistence unit has been created.This method is invoked when the persistence unit is fully initialized.
- Parameters:
em
- EntityManager from the created persistence unit
-
beforePersistenceUnitDestroyed
Invoked before the persistence unit is destroyed (typically on application shutdown).At the time of this call, all the entity managers from this persistence unit are already closed, but a connection to the underlying repository driver is still open.
- Parameters:
em
- Entity manager from the persistence unit that is shutting down
-