org.hibernate.resource.beans.spi.ManagedBeanRegistry Java Examples

The following examples show how to use org.hibernate.resource.beans.spi.ManagedBeanRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventListenerRegistryImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
EventListenerRegistryImpl(BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) {
	this.sessionFactory = sessionFactory;

	this.callbackRegistry = new CallbackRegistryImpl();
	this.callbackBuilder = new CallbackBuilderLegacyImpl(
			bootstrapContext.getServiceRegistry().getService( ManagedBeanRegistry.class ),
			bootstrapContext.getReflectionManager()
	);

	this.registeredEventListeners = buildListenerGroups();
}
 
Example #2
Source File: EventListenerRegistryImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void prepare(MetadataImplementor metadata) {
	if ( callbackBuilder == null ) {
		// TODO : not needed anymore when the deprecate constructor will be removed
		this.callbackBuilder = new CallbackBuilderLegacyImpl(
				sessionFactory.getServiceRegistry().getService( ManagedBeanRegistry.class ),
				metadata.getMetadataBuildingOptions().getReflectionManager()
		);
	}
	for ( PersistentClass persistentClass : metadata.getEntityBindings() ) {
		if ( persistentClass.getClassName() == null ) {
			// we can have non java class persisted by hibernate
			continue;
		}
		callbackBuilder.buildCallbacksForEntity( persistentClass.getClassName(), callbackRegistry );

		for ( Iterator propertyIterator = persistentClass.getDeclaredPropertyIterator();
				propertyIterator.hasNext(); ) {
			Property property = (Property) propertyIterator.next();

			if ( property.getType().isComponentType() ) {
				callbackBuilder.buildCallbacksForEmbeddable(
						property,
						persistentClass.getClassName(),
						callbackRegistry
				);
			}
		}
	}
}
 
Example #3
Source File: HibernateNativeEntityManagerFactorySpringBeanContainerIntegrationTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private ManagedBeanRegistry getManagedBeanRegistry() {
	SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);
	ServiceRegistry serviceRegistry = sessionFactory.getSessionFactoryOptions().getServiceRegistry();
	return serviceRegistry.requireService(ManagedBeanRegistry.class);
}
 
Example #4
Source File: HibernateNativeEntityManagerFactorySpringBeanContainerIntegrationTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
private ManagedBeanRegistry getManagedBeanRegistry() {
	SessionFactory sessionFactory = entityManagerFactory.unwrap( SessionFactory.class );
	ServiceRegistry serviceRegistry = sessionFactory.getSessionFactoryOptions().getServiceRegistry();
	return serviceRegistry.requireService( ManagedBeanRegistry.class );
}
 
Example #5
Source File: BeansMessageLogger.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@LogMessage( level = INFO )
@Message(
		id = 10005003,
		value = "Stopping ManagedBeanRegistry : %s"
)
void stoppingManagedBeanRegistry(ManagedBeanRegistry registry);
 
Example #6
Source File: CallbackBuilderLegacyImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public CallbackBuilderLegacyImpl(ManagedBeanRegistry managedBeanRegistry, ReflectionManager reflectionManager) {
	this.managedBeanRegistry = managedBeanRegistry;
	this.reflectionManager = reflectionManager;
}
 
Example #7
Source File: JpaAttributeConverterCreationContext.java    From lams with GNU General Public License v2.0 votes vote down vote up
ManagedBeanRegistry getManagedBeanRegistry();