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 Details

    • afterPersistenceUnitCreated

      default void afterPersistenceUnitCreated(EntityManager em)
      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

      default void beforePersistenceUnitDestroyed(EntityManager em)
      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