use of org.hibernate.service.spi.SessionFactoryServiceRegistry in project hibernate-orm by hibernate.
the class TestCollectionInitializingDuringFlush method prepareBootstrapRegistryBuilder.
@Override
protected void prepareBootstrapRegistryBuilder(BootstrapServiceRegistryBuilder builder) {
super.prepareBootstrapRegistryBuilder(builder);
builder.applyIntegrator(new Integrator() {
@Override
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
integrate(serviceRegistry);
}
private void integrate(SessionFactoryServiceRegistry serviceRegistry) {
serviceRegistry.getService(EventListenerRegistry.class).getEventListenerGroup(EventType.PRE_UPDATE).appendListener(InitializingPreUpdateEventListener.INSTANCE);
}
@Override
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
}
});
}
use of org.hibernate.service.spi.SessionFactoryServiceRegistry in project hibernate-orm by hibernate.
the class EagerKeyManyToOneTest method prepareBootstrapRegistryBuilder.
@Override
protected void prepareBootstrapRegistryBuilder(BootstrapServiceRegistryBuilder builder) {
super.prepareBootstrapRegistryBuilder(builder);
builder.applyIntegrator(new Integrator() {
@Override
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
integrate(serviceRegistry);
}
private void integrate(SessionFactoryServiceRegistry serviceRegistry) {
serviceRegistry.getService(EventListenerRegistry.class).prependListeners(EventType.LOAD, new CustomLoadListener());
}
@Override
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
}
});
}
use of org.hibernate.service.spi.SessionFactoryServiceRegistry in project uPortal by Jasig.
the class DelayedValidationQueryResolverImpl method setConfiguration.
@Override
public void setConfiguration(String persistenceUnit, HibernateConfiguration hibernateConfiguration) {
final SessionFactoryServiceRegistry serviceRegistry = hibernateConfiguration.getServiceRegistry();
synchronized (this.delayedDataSources) {
this.dialectResolver = serviceRegistry.getService(DialectResolver.class);
for (final Tuple<DataSource, ValidationQueryRegistrationHandler> delayedDataSource : this.delayedDataSources) {
final String validationQuery = this.getValidationQuery(delayedDataSource.first);
delayedDataSource.second.setValidationQuery(validationQuery);
}
this.delayedDataSources.clear();
}
}
Aggregations