Interface Integrator

All Known Implementing Classes:
BeanValidationIntegrator, CollectionCacheInvalidator, EnversIntegrator, SharedDriverManagerTypeCacheClearingIntegrator

@JavaServiceLoadable public interface Integrator
Contract for extensions that integrate with Hibernate.

The best way to make an implementation of Integrator available to Hibernate is by making it discoverable via the standard Java ServiceLoader facility.

Since:
4.0
Implementation Note:
integrate(Metadata, BootstrapContext, SessionFactoryImplementor) is called during the process of session factory initialization. In fact, it's called directly from the constructor of SessionFactoryImpl. So the passed session factory is not yet fully-initialized and is in a very fragile state.
  • Method Details

    • integrate

      default void integrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory)
      Perform integration.
      Parameters:
      metadata - The fully initialized boot-time mapping model
      bootstrapContext - The context for bootstrapping of the SessionFactory
      sessionFactory - The SessionFactory being created
    • disintegrate

      default void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry)
      Tongue-in-cheek name for a shutdown callback.
      Parameters:
      sessionFactory - The session factory being closed.
      serviceRegistry - That session factory's service registry