Interface Integrator
- All Known Implementing Classes:
BeanValidationIntegrator
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, Context, SessionFactoryImplementor)is called during the process of session factory initialization. In fact, it's called directly from the constructor ofSessionFactoryImpl. So the passed session factory is not yet fully-initialized and is in a very fragile state.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInputs which are valid during SessionFactory integration but are not represented by the finalized metadata or the in-flight SessionFactory. -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddisintegrate(SessionFactoryImplementor sessionFactory, Integrator.Context context) Tongue-in-cheek name for a shutdown callback.default voiddisintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) Deprecated, for removal: This API element is subject to removal in a future version.default voidintegrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Deprecated, for removal: This API element is subject to removal in a future version.default voidintegrate(Metadata metadata, Integrator.Context context, SessionFactoryImplementor sessionFactory) Perform integration.
-
Method Details
-
integrate
default void integrate(Metadata metadata, Integrator.Context context, SessionFactoryImplementor sessionFactory) Perform integration.- Parameters:
metadata- The fully initialized boot-time mapping modelcontext- The integration-time contextsessionFactory- The SessionFactory being created- Since:
- 8.0
-
integrate
@Deprecated(since="8.0", forRemoval=true) default void integrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Deprecated, for removal: This API element is subject to removal in a future version.Perform integration.- Parameters:
metadata- The fully initialized boot-time mapping modelbootstrapContext- The context for bootstrapping of the SessionFactorysessionFactory- The SessionFactory being created
-
disintegrate
Tongue-in-cheek name for a shutdown callback.- Parameters:
sessionFactory- The session factory being closed.context- The integration-time context- Since:
- 8.0
-
disintegrate
@Deprecated(since="8.0", forRemoval=true) default void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) Deprecated, for removal: This API element is subject to removal in a future version.Tongue-in-cheek name for a shutdown callback.- Parameters:
sessionFactory- The session factory being closed.serviceRegistry- That session factory's service registry
-
disintegrate(SessionFactoryImplementor, Context).