Namespaces

Types

Type ISessionImplementor

Namespace NHibernate.Engine

Interfaces ISession

Methods

Properties

Public instance methods

void AddArrayHolder(PersistentArrayHolder holder)

Register a IPersistentCollection object for an array
Parameters
PersistentArrayHolder holder

void AddNonExist(EntityKey key)

new in 2.1 no javadoc
Parameters
EntityKey key

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

Add an uninitialized instance of an entity class, as a placeholder to ensure object identity. Must be called before PostHydrate()
Parameters
EntityKey key
object obj
LockMode lockMode

void AfterLoad()

new in h2.1 and no javadoc

void AfterTransactionBegin(ITransaction tx)

Notify the session that an NHibernate transaction has begun.
Parameters
ITransaction tx

void AfterTransactionCompletion(bool successful, ITransaction tx)

Notify the session that the transaction completed, so we no longer own the old locks. (Also we shold release cache softlocks). May be called multiple times during the transaction completion process.
Parameters
bool successful
ITransaction tx

void BeforeLoad()

new in h2.1 and no javadoc

void BeforeTransactionCompletion(ITransaction tx)

Notify the session that the transaction is about to complete
Parameters
ITransaction tx

bool ContainsEntity(EntityKey key)

Parameters
return bool
EntityKey key

object Copy(object obj, IDictionary copiedAlready)

new in 2.1 no javadoc
Parameters
return object
object obj
IDictionary copiedAlready

void EndLoadingCollections(ICollectionPersister persister, object resultSetId)

new in h2.1 and no javadoc
Parameters
ICollectionPersister persister
object resultSetId

IEnumerable Enumerable(string query, QueryParameters parameters)

Execute an Iterate() query
Parameters
return IEnumerable
string query
QueryParameters parameters

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

Strongly-typed version of Enumerable
Parameters
return IEnumerable<T>
string query
QueryParameters queryParameters

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

Collection from a filter
Parameters
return IEnumerable
object collection
string filter
QueryParameters parameters

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

Strongly-typed version of EnumerableFilter
Parameters
return IEnumerable<T>
object collection
string filter
QueryParameters parameters

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

Execute a filter
Parameters
return IList
object collection
string filter
QueryParameters parameters

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

Execute a filter (strongly-typed version).
Parameters
return IList<T>
object collection
string filter
QueryParameters parameters

IList Find(string query, QueryParameters parameters)

Execute a Find() query
Parameters
return IList
string query
QueryParameters parameters

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

Parameters
string query
QueryParameters parameters
IList results

void Find(CriteriaImpl criteria, IList results)

Parameters
CriteriaImpl criteria
IList results

IList Find(CriteriaImpl criteria)

Parameters
return IList
CriteriaImpl criteria

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

Strongly-typed version of Find
Parameters
return IList<T>
CriteriaImpl criteria

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

Strongly-typed version of Find
Parameters
return IList<T>
string query
QueryParameters queryParameters

PersistentArrayHolder GetArrayHolder(object array)

Get the IPersistentCollection object for an array
Parameters
return PersistentArrayHolder
object array

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

Gets the NHibernate collection wrapper from the ISession.
Parameters
return object A NHibernate wrapped collection.
string role
object id
object owner

CollectionEntry GetCollectionEntry(IPersistentCollection collection)

Parameters
return CollectionEntry
IPersistentCollection collection

object GetCollectionOwner(object key, ICollectionPersister collectionPersister)

new in 2.1 no javadoc
Parameters
return object
object key
ICollectionPersister collectionPersister

object GetEntity(EntityKey key)

Get the entity instance associated with the given EntityKey
Parameters
return object
EntityKey key

object GetEntityIdentifier(object obj)

Return the identifier of the persistent object, or null if transient
Parameters
return object
object obj

object GetEntityIdentifierIfNotUnsaved(object obj)

Return the identifer of the persistent or transient object, or throw an exception if the instance is "unsaved"
Parameters
return object
object obj

IEntityPersister GetEntityPersister(object obj)

Get the IEntityPersister for an object
Parameters
return IEntityPersister
object obj

EntityEntry GetEntry(object entity)

Retrieve the EntityEntry representation of the given entity.
Parameters
return EntityEntry The EntityEntry for the given entity.
object entity The entity for which to locate the EntityEntry.

IType GetFilterParameterType(string filterParameterName)

Retreive the type for a given filter parrameter.
Parameters
return IType The filter parameter type.
string filterParameterName The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.

object GetFilterParameterValue(string filterParameterName)

Retreive the currently set value for a filter parameter.
Parameters
return object The filter parameter value.
string filterParameterName The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.

object GetLoadedCollectionKey(IPersistentCollection collection)

Get the pre-flush identifier of the collection
Parameters
return object
IPersistentCollection collection

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

new in h2.1 and no javadoc
Parameters
return IPersistentCollection
ICollectionPersister persister
object id
object resultSetId

LockMode GetLockMode(object entity)

Get the lock mode of the entity
Parameters
return LockMode
object entity

IQuery GetNamedSQLQuery(string name)

Parameters
return IQuery
string name

IQueryTranslator[] GetQueries(string query, bool scalar)

Parameters
return IQueryTranslator[]
string query
bool scalar

object GetSnapshot(IPersistentCollection collection)

Get the snapshot of the pre-flush collection state
Parameters
return object
IPersistentCollection collection

object GetVersion(object entity)

Get the current version of the entity
Parameters
return object
object entity

object ImmediateLoad(Type persistentClass, object id)

Load an instance immediately. Do not return a proxy.
Parameters
return object
Type persistentClass
object id

void InitializeCollection(IPersistentCollection coolection, bool writing)

Initialize the collection (if not already initialized)
Parameters
IPersistentCollection coolection
bool writing

void InitializeEntity(object obj)

Perform the second step of 2-phase load (ie. fully initialize the entity instance)
Parameters
object obj

void InitializeNonLazyCollections()

new in h2.1 and no javadoc

object Instantiate(Type clazz, object id)

Instantiate the entity class, initializing with the given identifier
Parameters
return object
Type clazz
object id

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

Load an instance without checking if it was deleted. If it does not exist and isn't nullable, throw an exception. This method may create a new proxy or return an existing proxy.
Parameters
return object A proxy of the object or an instance of the object if the persistentClass does not have a proxy.
Type persistentClass The Type to load.
object id The identifier of the object in the database.
bool eager When enabled, the object is eagerly fetched.
bool isNullable Allow null instance

bool IsInverseCollection(IPersistentCollection collection)

Is this the "inverse" end of a bidirectional association?
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)

Execute an SQL Query
Parameters
return IList
NativeSQLQuerySpecification spec
QueryParameters queryParameters

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

Strongly-typed version of List
Parameters
return IList<T>
NativeSQLQuerySpecification spec
QueryParameters queryParameters

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

Load an instance by a unique key that is not the primary key.
Parameters
return object
Type persistentClass
string uniqueKeyPropertyName
object id

void PostDelete(object obj)

After actually deleting a row, record the fact that the instance no longer exists on the database (needed for identity-column key generation)
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)

Return the existing proxy associated with the given object. (Slower than the form above)
Parameters
return object
object impl

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

Return the existing proxy associated with the given EntityKey , or the second argument (the entity associated with the key) if no proxy exists.
Parameters
return object Returns a the Proxy for the class or the parameter impl.
IEntityPersister persister The IEntityPersister to see if it should be Proxied.
EntityKey key The EntityKey that identifies the entity.
object impl

void SetLockMode(object entity, LockMode lockMode)

Set the lock mode of the entity to the given lock mode
Parameters
object entity
LockMode lockMode

Public properties

IBatcher Batcher get;

Get the prepared statement Batcher for this session
return IBatcher

BatchFetchQueue BatchFetchQueue get;

return BatchFetchQueue

IEnumerable CollectionEntries get;

return IEnumerable

IDictionary EnabledFilters get;

Return the currently enabled filters. The filter map is keyed by filter name, with values corresponding to the {@link org.hibernate.impl.FilterImpl} instance.
return IDictionary

ISessionFactoryImplementor Factory get;

Get the creating SessionFactoryImplementor
return ISessionFactoryImplementor

IInterceptor Interceptor get;

return IInterceptor

long Timestamp get;

System time before the start of the transaction
return long