Namespaces

Types

Type ISessionFactory

Namespace NHibernate

Interfaces IDisposable

Methods

Properties

Public instance methods

void Close()

Destroy this SessionFactory and release all resources connection pools, etc). It is the responsibility of the application to ensure that there are no open Session s before calling close() .

void Evict(Type persistentClass, object id)

Evict an entry from the process-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.
Parameters
Type persistentClass
object id

void Evict(Type persistentClass)

Evict all entries from the process-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.
Parameters
Type persistentClass

void EvictCollection(string roleName)

Evict all entries from the process-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.
Parameters
string roleName

void EvictCollection(string roleName, object id)

Evict an entry from the process-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.
Parameters
string roleName
object id

void EvictQueries(string cacheRegion)

Evict any query result sets cached in the named query cache region.
Parameters
string cacheRegion

void EvictQueries()

Evict any query result sets cached in the default query cache region.

IDictionary GetAllClassMetadata()

Get all ClassMetadata as a IDictionary from Type to metadata object
Parameters
return IDictionary

IDictionary GetAllCollectionMetadata()

Get all CollectionMetadata as a IDictionary from role name to metadata object
Parameters
return IDictionary

IClassMetadata GetClassMetadata(Type persistentType)

Get the ClassMetadata associated with the given entity class
Parameters
return IClassMetadata
Type persistentType

ICollectionMetadata GetCollectionMetadata(string roleName)

Get the CollectionMetadata associated with the named collection role
Parameters
return ICollectionMetadata
string roleName

ISession GetCurrentSession()

Obtains the current session.
Docu.Documentation.Comments.Paragraph
Parameters
return ISession The current session.

FilterDefinition GetFilterDefinition(string filterName)

Obtain the definition of a filter by name.
Parameters
return FilterDefinition
string filterName The name of the filter for which to obtain the definition.

IDatabinder OpenDatabinder()

Create a new databinder.
Parameters
return IDatabinder

ISession OpenSession(IDbConnection conn)

Open a ISession on the given connection
Note that the second-level cache will be disabled if you supply a ADO.NET connection. NHibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own IConnectionProvider .
Parameters
return ISession A session
IDbConnection conn A connection provided by the application

ISession OpenSession(IInterceptor interceptor)

Create database connection and open a ISession on it, specifying an interceptor
Parameters
return ISession A session
IInterceptor interceptor A session-scoped interceptor

ISession OpenSession()

Create a database connection and open a ISession on it
Parameters
return ISession

ISession OpenSession(IDbConnection conn, IInterceptor interceptor)

Open a ISession on the given connection, specifying an interceptor
Note that the second-level cache will be disabled if you supply a ADO.NET connection. NHibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own IConnectionProvider .
Parameters
return ISession A session
IDbConnection conn A connection provided by the application
IInterceptor interceptor A session-scoped interceptor

Public properties

IConnectionProvider ConnectionProvider get;

Get the IConnectionProvider used.
return IConnectionProvider

ICollection DefinedFilterNames get;

Obtain a set of the names of all filters defined on this SessionFactory.
return ICollection

Dialect Dialect get;

Get the SQL Dialect
return Dialect

IDictionary Items get;

This collections allows external libraries to add their own configuration to the NHibernate session factory. This is needed in such cases where the library is tightly coupled to NHibernate, such as the case of NHibernate Search
return IDictionary

Settings Settings get;

return Settings