C# Класс Castle.Facilities.NHibernateIntegration.NHibernateFacility

Provides a basic level of integration with the NHibernate project
This facility allows components to gain access to the NHibernate's objects: NHibernate.Cfg.Configuration NHibernate.ISessionFactory

It also allow you to obtain the ISession instance through the component ISessionManager, which is transaction aware and save you the burden of sharing session or using a singleton.

Наследование: Castle.MicroKernel.Facilities.AbstractFacility
Показать файл Открыть проект

Защищенные методы

Метод Описание
ApplyConfigurationSettings ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
ConfigureFacility ( ) : void
GenerateMappingFromAttributesIfNeeded ( NHibernate.Cfg.Configuration cfg, String targetAssembly ) : void

If targetAssembly has a reference on NHibernate.Mapping.Attributes : use the NHibernate mapping attributes contained in that assembly to update NHibernate configuration (cfg). Else do nothing

To avoid an unnecessary dependency on the library NHibernate.Mapping.Attributes.dll when using this facility without NHibernate mapping attributes, all calls to that library are made using reflexion.

Init ( ) : void
RegisterAssemblies ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
RegisterComponents ( ) : void
RegisterResources ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
RegisterSessionFactoryResolver ( ) : void
RegisterSessionManager ( ) : void
RegisterSessionStore ( ) : void
RegisterTransactionManager ( ) : void

Приватные методы

Метод Описание
AssertHasAtLeastOneFactoryConfigured ( ) : void
AssertHasConfig ( ) : void
ConfigureFactories ( IConfiguration config, ISessionFactoryResolver sessionFactoryResolver, bool firstFactory ) : void
ConfigureReflectionOptimizer ( IConfiguration config ) : void

Reads the attribute useReflectionOptimizer and configure the reflection optimizer accordingly.

As reported on Jira (FACILITIES-39) the reflection optimizer slow things down. So by default it will be disabled. You can use the attribute useReflectionOptimizer to turn it on.

ObtainAssembly ( String assembly ) : Assembly

Описание методов

ApplyConfigurationSettings() защищенный Метод

protected ApplyConfigurationSettings ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
cfg NHibernate.Cfg.Configuration
facilityConfig IConfiguration
Результат void

ConfigureFacility() защищенный Метод

protected ConfigureFacility ( ) : void
Результат void

GenerateMappingFromAttributesIfNeeded() защищенный Метод

If targetAssembly has a reference on NHibernate.Mapping.Attributes : use the NHibernate mapping attributes contained in that assembly to update NHibernate configuration (cfg). Else do nothing
To avoid an unnecessary dependency on the library NHibernate.Mapping.Attributes.dll when using this facility without NHibernate mapping attributes, all calls to that library are made using reflexion.
protected GenerateMappingFromAttributesIfNeeded ( NHibernate.Cfg.Configuration cfg, String targetAssembly ) : void
cfg NHibernate.Cfg.Configuration NHibernate configuration
targetAssembly String Target assembly name
Результат void

Init() защищенный Метод

protected Init ( ) : void
Результат void

RegisterAssemblies() защищенный Метод

protected RegisterAssemblies ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
cfg NHibernate.Cfg.Configuration
facilityConfig IConfiguration
Результат void

RegisterComponents() защищенный Метод

protected RegisterComponents ( ) : void
Результат void

RegisterResources() защищенный Метод

protected RegisterResources ( NHibernate.Cfg.Configuration cfg, IConfiguration facilityConfig ) : void
cfg NHibernate.Cfg.Configuration
facilityConfig IConfiguration
Результат void

RegisterSessionFactoryResolver() защищенный Метод

protected RegisterSessionFactoryResolver ( ) : void
Результат void

RegisterSessionManager() защищенный Метод

protected RegisterSessionManager ( ) : void
Результат void

RegisterSessionStore() защищенный Метод

protected RegisterSessionStore ( ) : void
Результат void

RegisterTransactionManager() защищенный Метод

protected RegisterTransactionManager ( ) : void
Результат void