Hibernate ORM ServiceRegistryImplementor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM ServiceRegistryImplementor class.

This code example shows how to use the following methods:getService
			throw new ServiceException( "Could not initialize custom PersisterClassResolver impl [" + customImplClass.getName() + "]", e );
		} 
	} 
 
	private Class<? extends PersisterClassResolver> locate(ServiceRegistryImplementor registry, String className) {
		return registry.getService( ClassLoaderService.class ).classForName( className );
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
			throw new ServiceException( "Could not initialize custom PersisterFactory impl [" + customImplClass.getName() + "]", e );
		} 
	} 
 
	private Class<? extends PersisterFactory> locate(ServiceRegistryImplementor registry, String className) {
		return registry.getService( ClassLoaderService.class ).classForName( className );
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
	public TransactionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { 
		final Object strategy = configurationValues.get( Environment.TRANSACTION_STRATEGY ); 
		if ( TransactionFactory.class.isInstance( strategy ) ) { 
			return (TransactionFactory) strategy; 
		} 
 
		if ( strategy == null ) { 
            LOG.usingDefaultTransactionStrategy(); 
			return new JdbcTransactionFactory(); 
		} 
 
		final String strategyClassName = mapLegacyNames( strategy.toString() ); 
        LOG.transactionStrategy(strategyClassName); 
 
		ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); 
		try { 
			return (TransactionFactory) classLoaderService.classForName( strategyClassName ).newInstance(); 
		} 
		catch ( Exception e ) { 
			throw new HibernateException( "Unable to instantiate specified TransactionFactory class [" + strategyClassName + "]", e ); 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
		catch (Exception e) {
			throw new ServiceException( "Could not build explicit BatchBuilder [" + builderClassName + "]", e );
		} 
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
 
	// todo this shouldn't be public (nor really static): 
	// hack for org.hibernate.cfg.SettingsFactory.createRegionFactory() 
	public static String mapLegacyNames(final String name) {
		if ( "org.hibernate.cache.EhCacheRegionFactory".equals( name ) ) {
			return "org.hibernate.cache.ehcache.EhCacheRegionFactory"; 
		} 
 
		if ( "org.hibernate.cache.SingletonEhCacheRegionFactory".equals( name ) ) {
			return "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"; 
		} 
 
		return name;
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:registerChild
		ServiceBinding<R> binding = locateServiceBinding( providedService.getServiceRole(), false ); 
		if ( binding == null ) { 
			binding = new ServiceBinding<R>( this, providedService.getServiceRole(), providedService.getService() ); 
			serviceBindingMap.put( providedService.getServiceRole(), binding ); 
		} 
		registerService( binding, providedService.getService() ); 
	} 
 
	@Override 
	@SuppressWarnings( {"unchecked"}) 
	public ServiceRegistry getParentServiceRegistry() { 
		return parent; 
	} 
 
	@Override 
	@SuppressWarnings({ "unchecked" }) 
	public <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole) { 
		return locateServiceBinding( serviceRole, true ); 
	} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
		} 
		return generatorClass; 
	} 
 
	@Override 
	public void injectServices(ServiceRegistryImplementor serviceRegistry) { 
		this.dialect = serviceRegistry.getService( JdbcServices.class ).getDialect(); 
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
		if ( persisterClass == null ) {
			persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getEntityPersisterClass( metadata );
		} 
		return create( persisterClass, ENTITY_PERSISTER_CONSTRUCTOR_ARGS, metadata, cacheAccessStrategy, factory, cfg );
	} 
 
	@Override 
	@SuppressWarnings( {"unchecked"}) 
	public EntityPersister createEntityPersister(EntityBinding metadata,
												 EntityRegionAccessStrategy cacheAccessStrategy,
												 SessionFactoryImplementor factory,
												 Mapping cfg) {
		Class<? extends EntityPersister> persisterClass = metadata.getCustomEntityPersisterClass();
		if ( persisterClass == null ) {
			persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getEntityPersisterClass( metadata );
		} 
		return create( persisterClass, ENTITY_PERSISTER_CONSTRUCTOR_ARGS_NEW, metadata, cacheAccessStrategy, factory, cfg );
	} 
 
	// TODO: change metadata arg type to EntityBinding when new metadata is integrated 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getService
		return SchemaDefiner.class; 
	} 
 
	@Override 
	public SchemaDefiner initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) {
		DatastoreProvider datastoreProvider = registry.getService( DatastoreProvider.class );
		Class<? extends SchemaDefiner> schemaInitializerType = datastoreProvider.getSchemaDefinerType();
 
		if ( schemaInitializerType != null ) {
			try { 
				return schemaInitializerType.newInstance();
			} 
			catch (Exception e) {
				throw log.unableToInstantiateType( schemaInitializerType.getName(), e );
			} 
		} 
 
		return new BaseSchemaDefiner(); 
	} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Hibernate ORM ServiceRegistryImplementor Methods: