C# Class Castle.ActiveRecord.AR

Performs the framework initialization.
This class is not thread safe.
Afficher le fichier Open project: shosca/ActiveRecord Class Usage Examples

Méthodes publiques

Méthode Description
Configure ( ) : DefaultActiveRecordConfiguration

Builds a fluent configuration for general ActiveRecord settings.

CreateSchema ( ) : void

Generates and executes the creation scripts for the database.

CreateSchema ( Type baseClass ) : void

Generates and executes the creation scripts for the database using the specified baseClass to know which database it should create the schema for.

CurrentScope ( ) : ISessionScope

Gets the current scope

DisposeCurrentScope ( ) : void

Disposes the current scope

DropSchema ( ) : void

Generates and executes the Drop scripts for the database.

DropSchema ( Type baseClass ) : void

Generates and executes the Drop scripts for the database using the specified baseClass to know which database it should create the scripts for.

GenerateCreationScripts ( String fileName ) : void

Generates the creation scripts for the database

If ActiveRecord was configured to access more than one database, a file is going to be generate for each, based on the path and the fileName specified.

GenerateCreationScripts ( Type baseType, String fileName ) : void

Generates the creation scripts for the database The baseType is used to identify which database should we act upon.

GenerateDropScripts ( String fileName ) : void

Generates the drop scripts for the database saving them to the supplied file name.

If ActiveRecord was configured to access more than one database, a file is going to be generate for each, based on the path and the fileName specified.

GenerateDropScripts ( Type baseType, String fileName ) : void

Generates the drop scripts for the database saving them to the supplied file name. The baseType is used to identify which database should we act upon.

Initialize ( ) : void

Initializes the framework reading the configuration from the AppDomain and checking all the types on the executing Assembly

Initialize ( this source ) : void

Initialize the mappings using the configuration and checking all the types on the specified Assemblies

ResetInitialization ( ) : void

Intended to be used only by test cases

UpdateSchema ( ) : IList

Generates and executes the creation scripts for the database.

UpdateSchema ( Type baseClass ) : IList

Generates and executes the creation scripts for the database using the specified baseClass to know which database it should create the schema for.

Private Methods

Méthode Description
CheckInitialized ( ) : void
CreateAnotherFile ( string originalFileName, int fileCount ) : string

Generate a file name based on the original file name specified, using the count to give it some order.

CreateSchemaExport ( NHibernate.Cfg.Configuration cfg ) : NHibernate.Tool.hbm2ddl.SchemaExport
CreateSchemaUpdate ( NHibernate.Cfg.Configuration cfg ) : NHibernate.Tool.hbm2ddl.SchemaUpdate
CreateSessionFactoryAndRegisterToHolder ( IActiveRecordConfiguration source ) : void

Initialize the mappings using the configuration and the list of types

CreateSessionFactoryHolderImplementation ( IActiveRecordConfiguration source ) : ISessionFactoryHolder
RaiseOnConfigurationCreated ( NHibernate.Cfg.Configuration cfg, SessionFactoryConfig sessionFactoryConfig ) : void
RaiseOnHbmMappingCreated ( NHibernate.Cfg.MappingSchema.HbmMapping mapping, SessionFactoryConfig sessionFactoryConfig ) : void
RaiseOnMapperCreated ( NHibernate.Mapping.ByCode.ConventionModelMapper mapper, SessionFactoryConfig sessionFactoryConfig ) : void
RaiseSessionFactoryCreated ( ISessionFactory sf, NHibernate cfg, string name ) : void
RaiseSessionFactoryHolderCreated ( ISessionFactoryHolder holder ) : void

Method Details

Configure() public static méthode

Builds a fluent configuration for general ActiveRecord settings.
public static Configure ( ) : DefaultActiveRecordConfiguration
Résultat DefaultActiveRecordConfiguration

CreateSchema() public static méthode

Generates and executes the creation scripts for the database.
public static CreateSchema ( ) : void
Résultat void

CreateSchema() public static méthode

Generates and executes the creation scripts for the database using the specified baseClass to know which database it should create the schema for.
public static CreateSchema ( Type baseClass ) : void
baseClass System.Type
Résultat void

CurrentScope() public static méthode

Gets the current scope
public static CurrentScope ( ) : ISessionScope
Résultat ISessionScope

DisposeCurrentScope() public static méthode

Disposes the current scope
public static DisposeCurrentScope ( ) : void
Résultat void

DropSchema() public static méthode

Generates and executes the Drop scripts for the database.
public static DropSchema ( ) : void
Résultat void

DropSchema() public static méthode

Generates and executes the Drop scripts for the database using the specified baseClass to know which database it should create the scripts for.
public static DropSchema ( Type baseClass ) : void
baseClass System.Type
Résultat void

GenerateCreationScripts() public static méthode

Generates the creation scripts for the database
If ActiveRecord was configured to access more than one database, a file is going to be generate for each, based on the path and the fileName specified.
public static GenerateCreationScripts ( String fileName ) : void
fileName String
Résultat void

GenerateCreationScripts() public static méthode

Generates the creation scripts for the database The baseType is used to identify which database should we act upon.
public static GenerateCreationScripts ( Type baseType, String fileName ) : void
baseType System.Type
fileName String
Résultat void

GenerateDropScripts() public static méthode

Generates the drop scripts for the database saving them to the supplied file name.
If ActiveRecord was configured to access more than one database, a file is going to be generate for each, based on the path and the fileName specified.
public static GenerateDropScripts ( String fileName ) : void
fileName String
Résultat void

GenerateDropScripts() public static méthode

Generates the drop scripts for the database saving them to the supplied file name. The baseType is used to identify which database should we act upon.
public static GenerateDropScripts ( Type baseType, String fileName ) : void
baseType System.Type
fileName String
Résultat void

Initialize() public static méthode

Initializes the framework reading the configuration from the AppDomain and checking all the types on the executing Assembly
public static Initialize ( ) : void
Résultat void

Initialize() public static méthode

Initialize the mappings using the configuration and checking all the types on the specified Assemblies
public static Initialize ( this source ) : void
source this
Résultat void

ResetInitialization() public static méthode

Intended to be used only by test cases
public static ResetInitialization ( ) : void
Résultat void

UpdateSchema() public static méthode

Generates and executes the creation scripts for the database.
public static UpdateSchema ( ) : IList
Résultat IList

UpdateSchema() public static méthode

Generates and executes the creation scripts for the database using the specified baseClass to know which database it should create the schema for.
public static UpdateSchema ( Type baseClass ) : IList
baseClass Type
Résultat IList