NHibernate : NHibernate Namespace

ISessionFactory Interface

Creates ISessions.

public interface ISessionFactory : IDisposable

Remarks

Usually an application has a single SessionFactory. Threads servicing client requests obtain ISessions from the factory. Implementors must be threadsafe.

ISessionFactorys are immutable. The behaviour of a SessionFactory is controlled by properties supplied at configuration time. These properties are defined on Environment

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Members

Public Properties

[read-only]
ConnectionProvider NHibernate.Connection.IConnectionProvider . Get the NHibernate.Connection.IConnectionProvider used.
[read-only]
DefinedFilterNames ICollection . Obtain a set of the names of all filters defined on this SessionFactory.
[read-only]
Dialect NHibernate.Dialect.Dialect . Get the SQL Dialect
[read-only]
Items IDictionary . Documentation for this section has not yet been entered.
[read-only]
Settings NHibernate.Cfg.Settings . Documentation for this section has not yet been entered.

Public Methods

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 Sessions before calling close().
Evict (Type)
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.
Evict (Type, object)
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.
EvictCollection (string)
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.
EvictCollection (string, object)
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.
EvictQueries ()
Evict any query result sets cached in the default query cache region.
EvictQueries (string)
Evict any query result sets cached in the named query cache region.
GetAllClassMetadata () : IDictionary
Get all ClassMetadata as a IDictionary from Type to metadata object
GetAllCollectionMetadata () : IDictionary
Get all CollectionMetadata as a IDictionary from role name to metadata object
GetClassMetadata (Type) : NHibernate.Metadata.IClassMetadata
Get the ClassMetadata associated with the given entity class
GetCollectionMetadata (string) : NHibernate.Metadata.ICollectionMetadata
Get the CollectionMetadata associated with the named collection role
GetCurrentSession () : ISession
Obtains the current session.
GetFilterDefinition (string) : NHibernate.Engine.FilterDefinition
Obtain the definition of a filter by name.
OpenDatabinder () : IDatabinder
Create a new databinder.
OpenSession () : ISession
Create a database connection and open a ISession on it
OpenSession (IInterceptor) : ISession
Create database connection and open a ISession on it, specifying an interceptor
OpenSession (System.Data.IDbConnection) : ISession
Open a ISession on the given connection
OpenSession (System.Data.IDbConnection, IInterceptor) : ISession
Open a ISession on the given connection, specifying an interceptor

Member Details

Close Method

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

public void Close ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

ConnectionProvider Property

Get the NHibernate.Connection.IConnectionProvider used.

public NHibernate.Connection.IConnectionProvider ConnectionProvider { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

DefinedFilterNames Property

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

public ICollection DefinedFilterNames { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Dialect Property

Get the SQL Dialect

public NHibernate.Dialect.Dialect Dialect { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Evict Method

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.

public void Evict (Type persistentClass)

Parameters

persistentClass

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Evict Method

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.

public void Evict (Type persistentClass, object id)

Parameters

persistentClass
id

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

EvictCollection Method

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.

public void EvictCollection (string roleName)

Parameters

roleName

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

EvictCollection Method

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.

public void EvictCollection (string roleName, object id)

Parameters

roleName
id

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

EvictQueries Method

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

public void EvictQueries ()

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

EvictQueries Method

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

public void EvictQueries (string cacheRegion)

Parameters

cacheRegion

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetAllClassMetadata Method

Get all ClassMetadata as a IDictionary from Type to metadata object

public IDictionary GetAllClassMetadata ()

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetAllCollectionMetadata Method

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

public IDictionary GetAllCollectionMetadata ()

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetClassMetadata Method

Get the ClassMetadata associated with the given entity class

public NHibernate.Metadata.IClassMetadata GetClassMetadata (Type persistentType)

Parameters

persistentType

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetCollectionMetadata Method

Get the CollectionMetadata associated with the named collection role

public NHibernate.Metadata.ICollectionMetadata GetCollectionMetadata (string roleName)

Parameters

roleName

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetCurrentSession Method

Obtains the current session.

public ISession GetCurrentSession ()

Returns

The current session.

Exceptions

Type Reason
NHibernate.HibernateException Indicates an issue locating a suitable current session.

Remarks

The definition of what exactly "current" means is controlled by the NHibernate.Context.ICurrentSessionContext implementation configured for use.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

GetFilterDefinition Method

Obtain the definition of a filter by name.

public NHibernate.Engine.FilterDefinition GetFilterDefinition (string filterName)

Parameters

filterName
The name of the filter for which to obtain the definition.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Items Property

Documentation for this section has not yet been entered.

public IDictionary Items { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

OpenDatabinder Method

Create a new databinder.

public IDatabinder OpenDatabinder ()

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

OpenSession Method

Create a database connection and open a ISession on it

public ISession OpenSession ()

Returns

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

OpenSession Method

Create database connection and open a ISession on it, specifying an interceptor

public ISession OpenSession (IInterceptor interceptor)

Parameters

interceptor
A session-scoped interceptor

Returns

A session

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

OpenSession Method

Open a ISession on the given connection

public ISession OpenSession (System.Data.IDbConnection conn)

Parameters

conn
A connection provided by the application

Returns

A session

Remarks

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 NHibernate.Connection.IConnectionProvider.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

OpenSession Method

Open a ISession on the given connection, specifying an interceptor

public ISession OpenSession (System.Data.IDbConnection conn, IInterceptor interceptor)

Parameters

conn
A connection provided by the application
interceptor
A session-scoped interceptor

Returns

A session

Remarks

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 NHibernate.Connection.IConnectionProvider.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000

Settings Property

Documentation for this section has not yet been entered.

public NHibernate.Cfg.Settings Settings { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll)
Assembly Versions: 1.2.1.4000