The Configuration type exposes the following members.

Constructors

  NameDescription
Public methodConfiguration()()()()
Create a new Configuration object.
Protected methodConfiguration(SettingsFactory)
Initializes a new instance of the Configuration class
Public methodConfiguration(SerializationInfo, StreamingContext)
Initializes a new instance of the Configuration class

Methods

  NameDescription
Public methodAddAssembly(Assembly)
Adds all of the assembly's embedded resources whose names end with .hbm.xml.
Public methodAddAssembly(String)
Adds all of the assembly's embedded resources whose names end with .hbm.xml.
Public methodAddAuxiliaryDatabaseObject
Public methodAddClass
Read a mapping from an embedded resource, using a convention.
Public methodAddDeserializedMapping
Add mapping data using deserialized class.
Public methodAddDirectory
Read all mapping documents from a directory tree. Assume that any file named *.hbm.xml is a mapping document.
Public methodAddDocument(XmlDocument)
Public methodAddDocument(XmlDocument, String)
Read mappings from an XmlDocument.
Public methodAddFile(FileInfo)
Public methodAddFile(String)
Read mappings from a particular XML file. This method is equivalent to AddXmlFile(String).
Public methodAddFilterDefinition
Public methodAddInputStream(Stream)
Read mappings from a Stream.
Public methodAddInputStream(Stream, String)
Read mappings from a Stream.
Public methodAddMapping
Public methodAddProperties
Adds an IDictionary of configuration properties. The Key is the name of the Property and the Value is the String value of the Property.
Public methodAddResource
Adds the mappings in the resource of the assembly.
Public methodAddResources
Adds the mappings from embedded resources of the assembly.
Public methodAddSqlFunction
Public methodAddUrl(String)
Read mappings from a URL.
Public methodAddUrl(Uri)
Read mappings from a URL.
Public methodAddXml(String)
Public methodAddXml(String, String)
Read mappings from a String. This method is equivalent to AddXmlString(String).
Public methodAddXmlFile
Read mappings from a particular XML file.
Public methodAddXmlReader(XmlReader)
Adds the Mappings in the XmlReader after validating it against the nhibernate-mapping-2.2 schema.
Public methodAddXmlReader(XmlReader, String)
Adds the Mappings in the XmlReader after validating it against the nhibernate-mapping-2.2 schema.
Public methodAddXmlString
Read mappings from a String.
Public methodAppendListeners
Append the listeners to the end of the currently configured listeners
Public methodBuildMapping
Public methodBuildMappings
Call this to ensure the mappings are fully compiled/built. Usefull to ensure getting access to all information in the metamodel when calling e.g. getClassMappings().
Public methodBuildSessionFactory
Instantiate a new ISessionFactory, using the properties and mappings in this configuration. The ISessionFactory will be immutable, so changes made to the configuration after building the ISessionFactory will not affect it.
Public methodConfigure()()()()
Configure NHibernate using the <hibernate-configuration> section from the application config file, if found, or the file hibernate.cfg.xml if the <hibernate-configuration> section not include the session-factory configuration.
Public methodConfigure(String)
Configure NHibernate using the file specified.
Public methodConfigure(XmlReader)
Configure NHibernate using the specified XmlReader.
Public methodConfigure(Assembly, String)
Configure NHibernate using a resource contained in an Assembly.
Protected methodConfigureProxyFactoryFactory
Public methodCreateMappings
Create a new Mappings to add classes and collection mappings to.
Protected methodDoConfigure
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGenerateDropSchemaScript
Generate DDL for dropping tables
Public methodGenerateSchemaCreationScript
Generate DDL for creating tables
Public methodGenerateSchemaUpdateScript
Generate DDL for altering tables
Public methodGetClassMapping(String)
Get the mapping for a particular entity
Public methodGetClassMapping(Type)
Get the mapping for a particular class
Public methodGetCollectionMapping
Get the mapping for a particular collection role
Protected methodGetDefaultConfigurationFilePath
Public methodGetDerivedProperties
Returns the set of properties computed from the default properties in the dialect combined with the other properties in the configuration.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetObjectData
Public methodGetProperty
Gets the value of the configuration property.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIncludeAction
Public methodLoadMappingDocument
Load and validate the mappings in the XmlReader against the nhibernate-mapping-2.2 schema, without adding them to the configuration.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReset
Clear the internal state of the Configuration object.
Public methodSetCacheConcurrencyStrategy(String, String)
Set up a cache for an entity class
Public methodSetCacheConcurrencyStrategy(String, String, String)
Public methodSetCollectionCacheConcurrencyStrategy
Set up a cache for a collection role
Public methodSetDefaultAssembly
Set the default assembly to use for the mappings added to the configuration afterwards.
Public methodSetDefaultNamespace
Set the default namespace to use for the mappings added to the configuration afterwards.
Public methodSetInterceptor
Sets the default interceptor for use by all sessions.
Public methodSetListener
Set or clear listener for a given ListenerType.
Public methodSetListeners(ListenerType, array<Object>[]()[][])
Set or clear listeners for a given ListenerType.
Public methodSetListeners(ListenerType, array<String>[]()[][])
Set or clear listener for a given ListenerType.
Public methodSetNamingStrategy
Set a custom naming strategy
Public methodSetProperties
Specify a completely new set of properties
Public methodSetProperty
Sets the value of the configuration property.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidateSchema

Extension Methods

  NameDescription
Public Extension MethodAddNamedQuery (Defined by ConfigurationExtensions.)
Public Extension MethodAs<(Of <<'(T>)>>) (Defined by TypeHelperExtensionMethods.)
Public Extension MethodCache (Defined by ConfigurationExtensions.)
Public Extension MethodCollectionTypeFactory<(Of <<'(TCollecionsFactory>)>>) (Defined by ConfigurationExtensions.)
Public Extension MethodCurrentSessionContext<(Of <<'(TCurrentSessionContext>)>>) (Defined by ConfigurationExtensions.)
Public Extension MethodDataBaseIntegration (Defined by ConfigurationExtensions.)
Public Extension MethodEntityCache<(Of <<'(TEntity>)>>) (Defined by ConfigurationExtensions.)
Public Extension MethodHqlQueryTranslator<(Of <<'(TQueryTranslator>)>>) (Defined by ConfigurationExtensions.)
Public Extension MethodIsBetween
Apply a "between" constraint to the named property Note: throws an exception outside of a QueryOver expression
(Defined by RestrictionExtensions.)
Public Extension MethodIsIn(array<Object>[]()[][])Overloaded.
Apply an "in" constraint to the named property Note: throws an exception outside of a QueryOver expression
(Defined by RestrictionExtensions.)
Public Extension MethodIsIn(ICollection)Overloaded.
Apply an "in" constraint to the named property Note: throws an exception outside of a QueryOver expression
(Defined by RestrictionExtensions.)
Public Extension MethodIsProxy (Defined by NHibernateProxyHelper.)
Public Extension MethodLinqToHqlGeneratorsRegistry<(Of <<'(TLinqToHqlGeneratorsRegistry>)>>) (Defined by ConfigurationExtensions.)
Public Extension MethodMappings (Defined by ConfigurationExtensions.)
Public Extension MethodProxy (Defined by ConfigurationExtensions.)
Public Extension MethodSessionFactory (Defined by ConfigurationExtensions.)
Public Extension MethodSessionFactoryName (Defined by ConfigurationExtensions.)
Public Extension MethodToTypeParameters (Defined by ReflectHelper.)
Public Extension MethodTypeDefinition<(Of <<'(TDef>)>>)
Add a type-definition for mappings.
(Defined by ConfigurationExtensions.)

Fields

Properties

  NameDescription
Public propertyClassMappings
The class mappings
Public propertyCollectionMappings
The collection mappings
Public propertyEntityNotFoundDelegate
Retrieve the user-supplied delegate to handle non-existent entity scenarios.
Public propertyEventListeners
Public propertyFilterDefinitions
Public propertyImports
Get the query language imports (entityName/className -> AssemblyQualifiedName)
Public propertyInterceptor
Gets or sets the IInterceptor to use.
Public propertyNamedQueries
The named queries
Public propertyNamedSQLQueries
The named SQL queries
Public propertyNamingStrategy
Naming strategy for tables and columns
Public propertyProperties
Gets or sets the IDictionary that contains the configuration properties and their values.
Public propertySqlFunctions
Public propertySqlResultSetMappings

Events

See Also