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
파일 보기 프로젝트 열기: nats/castle-1.0.3-mono

보호된 메소드들

메소드 설명
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