Namespaces

Types

Type SessionImpl

Namespace NHibernate.Impl

Interfaces ISessionImplementor, ISerializable, IDeserializationCallback

Methods

Properties

Public instance methods

void AddArrayHolder(PersistentArrayHolder holder)

associate a holder with an array - called after loading an array
Parameters
PersistentArrayHolder holder

CollectionEntry AddInitializedCollection(IPersistentCollection collection, ICollectionPersister persister, object id)

add a collection we just pulled out of the cache (does not need initializing)
Parameters
return CollectionEntry
IPersistentCollection collection
ICollectionPersister persister
object id

void AddNonExist(EntityKey key)

Parameters
EntityKey key

void AddUninitializedEntity(EntityKey key, object obj, LockMode lockMode)

Create a "temporary" entry for a newly instantiated entity. The entity is uninitialized, but we need the mapping from id to instance in order to guarantee uniqueness.
Parameters
EntityKey key
object obj
LockMode lockMode

void AfterLoad()

void AfterTransactionBegin(ITransaction tx)

Parameters
ITransaction tx

void AfterTransactionCompletion(bool success, ITransaction tx)

Ensure that the locks are downgraded to None and that all of the softlocks in the NHibernate.Cache have been released.
Parameters
bool success
ITransaction tx

void BeforeLoad()

void BeforeTransactionCompletion(ITransaction tx)

Parameters
ITransaction tx

ITransaction BeginTransaction(IsolationLevel isolationLevel)

Parameters
return ITransaction
IsolationLevel isolationLevel

ITransaction BeginTransaction()

Parameters
return ITransaction

void CancelQuery()

void Clear()

IDbConnection Close()

Parameters
return IDbConnection

bool Contains(object obj)

Parameters
return bool
object obj

bool ContainsEntity(EntityKey key)

Parameters
return bool
EntityKey key

object Copy(object obj, IDictionary copiedAlready)

Parameters
return object
object obj
IDictionary copiedAlready

ICriteria CreateCriteria(Type persistentClass)

Parameters
return ICriteria
Type persistentClass

ICriteria CreateCriteria(Type persistentClass, string alias)

Parameters
return ICriteria
Type persistentClass
string alias

IQuery CreateFilter(object collection, string queryString)

Parameters
return IQuery
object collection
string queryString

IMultiQuery CreateMultiQuery()

Parameters
return IMultiQuery

IQuery CreateQuery(string queryString)

Parameters
return IQuery
string queryString

IQuery CreateSQLQuery(string sql, string returnAlias, Type returnClass)

Parameters
return IQuery
string sql
string returnAlias
Type returnClass

IQuery CreateSQLQuery(string sql, String[] returnAliases, Type[] returnClasses, ICollection querySpaces)

Parameters
return IQuery
string sql
String[] returnAliases
Type[] returnClasses
ICollection querySpaces

IQuery CreateSQLQuery(string sql, String[] returnAliases, Type[] returnClasses)

Parameters
return IQuery
string sql
String[] returnAliases
Type[] returnClasses

ISQLQuery CreateSQLQuery(string sql)

Parameters
return ISQLQuery
string sql

int Delete(string query, object value, IType type)

Parameters
return int
string query
object value
IType type

void Delete(object obj)

Delete a persistent object
Parameters
object obj

int Delete(string query, Object[] values, IType[] types)

Parameters
return int
string query
Object[] values
IType[] types

int Delete(string query)

Parameters
return int
string query

void DisableFilter(string filterName)

Parameters
string filterName

IDbConnection Disconnect()

Parameters
return IDbConnection

void Dispose()

Just in case the user forgot to Commit() or Close()

object DoCopy(object obj, object id, IDictionary copiedAlready)

Parameters
return object
object obj
object id
IDictionary copiedAlready

IFilter EnableFilter(string filterName)

Parameters
return IFilter
string filterName

void EndLoadingCollections(ICollectionPersister persister, object resultSetId)

Parameters
ICollectionPersister persister
object resultSetId

IEnumerable Enumerable(string query, Object[] values, IType[] types)

Parameters
return IEnumerable
string query
Object[] values
IType[] types

IEnumerable Enumerable(string query)

Parameters
return IEnumerable
string query

IEnumerable Enumerable(string query, object value, IType type)

Parameters
return IEnumerable
string query
object value
IType type

IEnumerable Enumerable(string query, QueryParameters parameters)

Parameters
return IEnumerable
string query
QueryParameters parameters

IEnumerable<T> Enumerable<T>(string query, QueryParameters parameters)

Parameters
return IEnumerable<T>
string query
QueryParameters parameters

IEnumerable EnumerableFilter(object collection, string filter, QueryParameters parameters)

Parameters
return IEnumerable
object collection
string filter
QueryParameters parameters

IEnumerable<T> EnumerableFilter<T>(object collection, string filter, QueryParameters parameters)

Parameters
return IEnumerable<T>
object collection
string filter
QueryParameters parameters

bool Equals(object obj)

Parameters
return bool
object obj

void Evict(object obj)

remove any hard references to the entity that are held by the infrastructure (references held by application or other persistant instances are okay)
Parameters
object obj

IList Filter(object collection, string filter, QueryParameters parameters)

Parameters
return IList
object collection
string filter
QueryParameters parameters

ICollection Filter(object collection, string filter)

Parameters
return ICollection
object collection
string filter

void Filter(object collection, string filter, QueryParameters parameters, IList results)

Parameters
object collection
string filter
QueryParameters parameters
IList results

ICollection Filter(object collection, string filter, object value, IType type)

Parameters
return ICollection
object collection
string filter
object value
IType type

ICollection Filter(object collection, string filter, Object[] values, IType[] types)

Parameters
return ICollection
object collection
string filter
Object[] values
IType[] types

IList<T> Filter<T>(object collection, string filter, QueryParameters parameters)

Parameters
return IList<T>
object collection
string filter
QueryParameters parameters

IList Find(string query, object value, IType type)

Parameters
return IList
string query
object value
IType type

IList Find(string query, Object[] values, IType[] types)

Parameters
return IList
string query
Object[] values
IType[] types

IList Find(string query)

Retrieve a list of persistent objects using a Hibernate query
Parameters
return IList
string query

IList Find(CriteriaImpl criteria)

Parameters
return IList
CriteriaImpl criteria

IList Find(string query, QueryParameters parameters)

Parameters
return IList
string query
QueryParameters parameters

void Find(CriteriaImpl criteria, IList results)

Parameters
CriteriaImpl criteria
IList results

void Find(string query, QueryParameters parameters, IList results)

Parameters
string query
QueryParameters parameters
IList results

IList<T> Find<T>(string query, QueryParameters parameters)

Parameters
return IList<T>
string query
QueryParameters parameters

IList<T> Find<T>(CriteriaImpl criteria)

Parameters
return IList<T>
CriteriaImpl criteria

void Flush()

This can be called from commit() or at the start of a Find() method. Docu.Documentation.Comments.Paragraph Docu.Documentation.Comments.Paragraph

object Get(Type clazz, object id, LockMode lockMode)

Load the data for the object with the specified id into a newly created object using "for update", if supported. A new key will be assigned to the object. This should return an existing proxy where appropriate. If the object does not exist in the database, null is returned.
Parameters
return object
Type clazz
object id
LockMode lockMode

object Get(Type clazz, object id)

Parameters
return object
Type clazz
object id

T Get<T>(object id, LockMode lockMode)

Parameters
return T
object id
LockMode lockMode

T Get<T>(object id)

Parameters
return T
object id

PersistentArrayHolder GetArrayHolder(object array)

Parameters
return PersistentArrayHolder
object array

Object[] GetClassBatch(Type clazz, object id, int batchSize)

Parameters
return Object[]
Type clazz
object id
int batchSize

object GetCollection(string role, object id, object owner)

Instantiate a collection wrapper (called when loading an object)
Parameters
return object
string role
object id
object owner

Object[] GetCollectionBatch(ICollectionPersister collectionPersister, object id, int batchSize)

Parameters
return Object[]
ICollectionPersister collectionPersister
object id
int batchSize

CollectionEntry GetCollectionEntry(IPersistentCollection coll)

Parameters
return CollectionEntry
IPersistentCollection coll

object GetCollectionOwner(object key, ICollectionPersister collectionPersister)

Parameters
return object
object key
ICollectionPersister collectionPersister

LockMode GetCurrentLockMode(object obj)

Parameters
return LockMode
object obj

IFilter GetEnabledFilter(string filterName)

Parameters
return IFilter
string filterName

object GetEntity(EntityKey key)

Parameters
return object
EntityKey key

object GetEntityIdentifier(object obj)

Get the id value for an object that is actually associated with the session. This is a bit stricter than GetEntityIdentifierIfNotUnsaved().
Parameters
return object
object obj

object GetEntityIdentifierIfNotUnsaved(object obj)

Used by OneToOneType and ManyToOneType to determine what id value should be used for an object that may or may not be associated with the session. This does a "best guess" using any/all info available to use (not just the EntityEntry).
Parameters
return object
object obj

IEntityPersister GetEntityPersister(object obj)

Parameters
return IEntityPersister
object obj

EntityEntry GetEntry(object obj)

Parameters
return EntityEntry
object obj

IType GetFilterParameterType(string filterParameterName)

Parameters
return IType
string filterParameterName

object GetFilterParameterValue(string filterParameterName)

Parameters
return object
string filterParameterName

int GetHashCode()

Parameters
return int

object GetIdentifier(object obj)

Not for internal use
Parameters
return object
object obj

object GetLoadedCollectionKey(IPersistentCollection coll)

Parameters
return object
IPersistentCollection coll

IPersistentCollection GetLoadingCollection(ICollectionPersister persister, object id, object resultSetId)

Parameters
return IPersistentCollection
ICollectionPersister persister
object id
object resultSetId

LockMode GetLockMode(object entity)

Parameters
return LockMode
object entity

IQuery GetNamedQuery(string queryName)

Obtain an instance of IQuery for a named query string defined in the mapping file.
The query can be either in hql or sql format.
Parameters
return IQuery An IQuery fro a named query string.
string queryName The name of a query defined externally.

IQuery GetNamedSQLQuery(string queryName)

Parameters
return IQuery
string queryName

IQueryTranslator[] GetQueries(string query, bool scalar)

Parameters
return IQueryTranslator[]
string query
bool scalar

ISessionImplementor GetSessionImplementation()

Parameters
return ISessionImplementor

object GetSnapshot(IPersistentCollection coll)

Parameters
return object
IPersistentCollection coll

Type GetType()

Parameters
return Type

object GetVersion(object entity)

Parameters
return object
object entity

object ImmediateLoad(Type clazz, object id)

Load the data for the object with the specified id into a newly created object. Do NOT return a proxy.
Parameters
return object
Type clazz
object id

void InitializeCollection(IPersistentCollection collection, bool writing)

called by a collection that wants to initialize itself
Parameters
IPersistentCollection collection
bool writing

void InitializeEntity(object obj)

After processing a JDBC result set, we "resolve" all the associations between the entities which were instantiated and had their state "hydrated" into an array
Parameters
object obj

void InitializeNonLazyCollections()

object Instantiate(Type clazz, object id)

Parameters
return object
Type clazz
object id

object Instantiate(IEntityPersister persister, object id)

Give the interceptor an opportunity to override the default instantiation
Parameters
return object
IEntityPersister persister
object id

object InternalLoad(Type clazz, object id, bool eager, bool isNullable)

Return the object with the specified id or throw exception if no row with that id exists. Defer the load, return a new proxy or return an existing proxy if possible. Do not check if the object was deleted.
Parameters
return object
Type clazz
object id
bool eager
bool isNullable

bool IsDirty()

Parameters
return bool

bool IsInverseCollection(IPersistentCollection collection)

Parameters
return bool
IPersistentCollection collection

bool IsSaved(object obj)

Parameters
return bool
object obj

void List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results)

Parameters
NativeSQLQuerySpecification spec
QueryParameters queryParameters
IList results

IList List(NativeSQLQuerySpecification spec, QueryParameters queryParameters)

Parameters
return IList
NativeSQLQuerySpecification spec
QueryParameters queryParameters

IList<T> List<T>(NativeSQLQuerySpecification spec, QueryParameters queryParameters)

Parameters
return IList<T>
NativeSQLQuerySpecification spec
QueryParameters queryParameters

void ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results)

Parameters
ICustomQuery customQuery
QueryParameters queryParameters
IList results

IList<T> ListCustomQuery<T>(ICustomQuery customQuery, QueryParameters queryParameters)

Parameters
return IList<T>
ICustomQuery customQuery
QueryParameters queryParameters

object Load(Type clazz, object id)

Parameters
return object
Type clazz
object id

object Load(Type clazz, object id, LockMode lockMode)

Load the data for the object with the specified id into a newly created object using "for update", if supported. A new key will be assigned to the object. This should return an existing proxy where appropriate. If the object does not exist in the database, an exception is thrown.
Parameters
return object
Type clazz
object id
LockMode lockMode

void Load(object obj, object id)

Parameters
object obj
object id

T Load<T>(object id)

Parameters
return T
object id

T Load<T>(object id, LockMode lockMode)

Parameters
return T
object id
LockMode lockMode

object LoadByUniqueKey(Type clazz, string uniqueKeyPropertyName, object id)

Parameters
return object
Type clazz
string uniqueKeyPropertyName
object id

void Lock(object obj, LockMode lockMode)

Parameters
object obj
LockMode lockMode

object NarrowProxy(object proxy, IEntityPersister persister, EntityKey key, object obj)

If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy and overwrite the registration of the old one. This breaks == and occurs only for "class" proxies rather than "interface" proxies.
Parameters
return object
object proxy
IEntityPersister persister
EntityKey key
object obj

void PostDelete(object obj)

Parameters
object obj

void PostHydrate(IEntityPersister persister, object id, Object[] values, object obj, LockMode lockMode)

Parameters
IEntityPersister persister
object id
Object[] values
object obj
LockMode lockMode

object ProxyFor(object impl)

Parameters
return object
object impl

object ProxyFor(IEntityPersister persister, EntityKey key, object impl)

Grab the existing proxy for an instance, if one exists. (otherwise return the instance)
Parameters
return object
IEntityPersister persister
EntityKey key
object impl

void Reconnect(IDbConnection conn)

Parameters
IDbConnection conn

void Reconnect()

void Refresh(object obj)

Parameters
object obj

void Refresh(object obj, LockMode lockMode)

Parameters
object obj
LockMode lockMode

void Replicate(object obj, ReplicationMode replicationMode)

Parameters
object obj
ReplicationMode replicationMode

void Save(object obj, object id)

Save a transient object with a manually assigned ID
Parameters
object obj
object id

object Save(object obj)

Save a transient object. An id is generated, assigned to the object and returned
Parameters
return object
object obj

void SaveOrUpdate(object obj)

Parameters
object obj

object SaveOrUpdateCopy(object obj, object id)

Parameters
return object
object obj
object id

object SaveOrUpdateCopy(object obj)

Parameters
return object
object obj

void ScheduleBatchLoad(Type clazz, object id)

Parameters
Type clazz
object id

void SetLockMode(object entity, LockMode lockMode)

Parameters
object entity
LockMode lockMode

string ToString()

Parameters
return string

void Update(object obj)

Parameters
object obj

void Update(object obj, object id)

Parameters
object obj
object id

void UpdateReachableCollection(IPersistentCollection coll, IType type, object owner)

Initialize the role of the collection. The CollectionEntry.reached stuff is just to detect any silly users who set up circular or shared references between/to collections.
Parameters
IPersistentCollection coll
IType type
object owner

Public properties

IBatcher Batcher get;

return IBatcher

BatchFetchQueue BatchFetchQueue get;

return BatchFetchQueue

IEnumerable CollectionEntries get;

return IEnumerable

IDbConnection Connection get;

return IDbConnection

ConnectionManager ConnectionManager get;

return ConnectionManager

IDictionary EnabledFilters get;

return IDictionary

ISessionFactoryImplementor Factory get;

return ISessionFactoryImplementor

FlushMode FlushMode get; set;

return FlushMode

IInterceptor Interceptor get;

return IInterceptor

bool IsConnected get;

Gets if the ISession is connected.
An ISession is considered connected if there is an IDbConnection (regardless of its state) or if it the field connect is true. Meaning that it will connect at the next operation that requires a connection.
return bool

bool IsOpen get;

return bool

ISessionFactory SessionFactory get;

return ISessionFactory

long Timestamp get;

return long

ITransaction Transaction get;

return ITransaction