The ISession type exposes the following members.
Methods
Name | Description | |
---|---|---|
BeginTransaction()()()() |
Begin a unit of work and return the associated ITransaction object.
| |
BeginTransaction(IsolationLevel) |
Begin a transaction with the specified isolationLevel | |
CancelQuery |
Cancel execution of the current query.
| |
Clear |
Completely clear the session. Evict all loaded instances and cancel all pending
saves, updates and deletions. Do not close open enumerables or instances of
ScrollableResults.
| |
Close |
End the ISession by disconnecting from the ADO.NET connection and cleaning up.
| |
Contains |
Is this instance associated with this Session?
| |
CreateCriteria(String) |
Create a new Criteria instance, for the given entity name.
| |
CreateCriteria(Type) |
Creates a new Criteria for the entity class.
| |
CreateCriteria(String, String) |
Create a new Criteria instance, for the given entity name,
with the given alias.
| |
CreateCriteria(Type, String) |
Creates a new Criteria for the entity class with a specific alias
| |
CreateCriteria<(Of <<'(T>)>>)()()()() |
Creates a new Criteria for the entity class.
| |
CreateCriteria<(Of <<'(T>)>>)(String) |
Creates a new Criteria for the entity class with a specific alias
| |
CreateFilter |
Create a new instance of Query for the given collection and filter string
| |
CreateMultiCriteria |
An IMultiCriteria that can return a list of all the results
of all the criterias.
| |
CreateMultiQuery |
Create a multi query, a query that can send several
queries to the server, and return all their results in a single
call.
| |
CreateQuery |
Create a new instance of Query for the given query string
| |
CreateSQLQuery |
Create a new instance of ISQLQuery for the given SQL query string.
| |
Delete(Object) |
Remove a persistent instance from the datastore.
| |
Delete(String) |
Delete all objects returned by the query.
| |
Delete(String, Object) |
Remove a persistent instance from the datastore. The object argument may be
an instance associated with the receiving ISession or a transient
instance with an identifier associated with existing persistent state.
This operation cascades to associated instances if the association is mapped
with cascade="delete".
| |
Delete(String, Object, IType) |
Delete all objects returned by the query.
| |
Delete(String, array<Object>[]()[][], array<IType>[]()[][]) |
Delete all objects returned by the query.
| |
DisableFilter |
Disable the named filter for the current session.
| |
Disconnect |
Disconnect the ISession from the current ADO.NET connection.
| |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.) | |
EnableFilter |
Enable the named filter for this current session.
| |
Evict |
Remove this instance from the session cache.
| |
Flush |
Force the ISession to flush.
| |
Get(String, Object) |
Return the persistent instance of the given named entity with the given identifier,
or null if there is no such persistent instance. (If the instance, or a proxy for the
instance, is already associated with the session, return that instance or proxy.)
| |
Get(Type, Object) |
Return the persistent instance of the given entity class with the given identifier, or null
if there is no such persistent instance. (If the instance, or a proxy for the instance, is
already associated with the session, return that instance or proxy.)
| |
Get(Type, Object, LockMode) |
Return the persistent instance of the given entity class with the given identifier, or null
if there is no such persistent instance. Obtain the specified lock mode if the instance
exists.
| |
Get<(Of <<'(T>)>>)(Object) |
Strongly-typed version of Get(Type, Object) | |
Get<(Of <<'(T>)>>)(Object, LockMode) |
Strongly-typed version of Get(Type, Object, LockMode) | |
GetCurrentLockMode |
Determine the current lock mode of the given object
| |
GetEnabledFilter |
Retrieve a currently enabled filter by name.
| |
GetEntityName |
Return the entity name for a persistent entity
| |
GetIdentifier |
Return the identifier of an entity instance cached by the ISession | |
GetNamedQuery |
Obtain an instance of IQuery for a named query string defined in the
mapping file.
| |
GetSession |
Starts a new Session with the given entity mode in effect. This secondary
Session inherits the connection, transaction, and other context
information from the primary Session. It doesn't need to be flushed
or closed by the developer.
| |
GetSessionImplementation |
Gets the session implementation.
| |
IsDirty |
Does this ISession contain any changes which must be
synchronized with the database? Would any SQL be executed if
we flushed this session?
| |
IsReadOnly |
Is the specified entity (or proxy) read-only?
| |
Load(Object, Object) |
Read the persistent state associated with the given identifier into the given transient
instance.
| |
Load(String, Object) |
Return the persistent instance of the given entityName with the given identifier,
assuming that the instance exists.
| |
Load(Type, Object) |
Return the persistent instance of the given entity class with the given identifier,
assuming that the instance exists.
| |
Load(String, Object, LockMode) |
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
| |
Load(Type, Object, LockMode) |
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode.
| |
Load<(Of <<'(T>)>>)(Object) |
Return the persistent instance of the given entity class with the given identifier,
assuming that the instance exists.
| |
Load<(Of <<'(T>)>>)(Object, LockMode) |
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode.
| |
Lock(Object, LockMode) |
Obtain the specified lock level upon the given object.
| |
Lock(String, Object, LockMode) |
Obtain the specified lock level upon the given object.
| |
Merge(Object) |
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge". The semantics of this method are defined by JSR-220. | |
Merge(String, Object) |
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge". The semantics of this method are defined by JSR-220. Name of the entity.a detached instance with state to be copied Return Valuean updated persistent instance | |
Merge<(Of <<'(T>)>>)(T) |
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge". The semantics of this method are defined by JSR-220. | |
Merge<(Of <<'(T>)>>)(String, T) |
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge". The semantics of this method are defined by JSR-220. Name of the entity.a detached instance with state to be copied Return Valuean updated persistent instance | |
Persist(Object) |
Make a transient instance persistent. This operation cascades to associated
instances if the association is mapped with cascade="persist". The semantics of this method are defined by JSR-220. | |
Persist(String, Object) |
Make a transient instance persistent. This operation cascades to associated
instances if the association is mapped with cascade="persist". The semantics of this method are defined by JSR-220. | |
QueryOver<(Of <<'(T>)>>)()()()() |
Creates a new IQueryOver<T> for the entity class.
| |
QueryOver<(Of <<'(T>)>>)(Expression<(Of <<'(Func<(Of <<'(T>)>>)>)>>)) |
Creates a new IQueryOver<T> for the entity class.
| |
QueryOver<(Of <<'(T>)>>)(String) |
Creates a new IQueryOver{T}; for the entity class.
| |
QueryOver<(Of <<'(T>)>>)(String, Expression<(Of <<'(Func<(Of <<'(T>)>>)>)>>)) |
Creates a new IQueryOver{T} for the entity class.
| |
Reconnect()()()() |
Obtain a new ADO.NET connection.
| |
Reconnect(IDbConnection) |
Reconnect to the given ADO.NET connection.
| |
Refresh(Object) |
Re-read the state of the given instance from the underlying database.
| |
Refresh(Object, LockMode) |
Re-read the state of the given instance from the underlying database, with
the given LockMode.
| |
Replicate(Object, ReplicationMode) |
Persist all reachable transient objects, reusing the current identifier
values. Note that this will not trigger the Interceptor of the Session.
| |
Replicate(String, Object, ReplicationMode) |
Persist the state of the given detached instance, reusing the current
identifier value. This operation cascades to associated instances if
the association is mapped with cascade="replicate".
| |
Save(Object) |
Persist the given transient instance, first assigning a generated identifier.
| |
Save(Object, Object) |
Persist the given transient instance, using the given identifier.
| |
Save(String, Object) |
Persist the given transient instance, first assigning a generated identifier. (Or
using the current value of the identifier property if the assigned
generator is used.)
| |
SaveOrUpdate(Object) |
Either Save() or Update() the given instance, depending upon the value of
its identifier property.
| |
SaveOrUpdate(String, Object) |
Either Save(String, Object) or Update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking).
| |
SaveOrUpdateCopy(Object) | Obsolete.
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved or does not exist in the database, save it and
return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
| |
SaveOrUpdateCopy(Object, Object) | Obsolete.
Copy the state of the given object onto the persistent object with the
given identifier. If there is no persistent instance currently associated
with the session, it will be loaded. Return the persistent instance. If
there is no database row with the given identifier, save the given instance
and return it as a newly persistent instance. Otherwise, the given instance
does not become associated with the session.
| |
SetBatchSize |
Sets the batch size of the session
| |
SetReadOnly |
Change the read-only status of an entity (or proxy).
| |
Update(Object) |
Update the persistent instance with the identifier of the given transient instance.
| |
Update(Object, Object) |
Update the persistent state associated with the given identifier.
| |
Update(String, Object) |
Update the persistent instance with the identifier of the given detached
instance.
|
Extension Methods
Name | Description | |
---|---|---|
Query<(Of <<'(T>)>>) | (Defined by LinqExtensionMethods.) |
Properties
Name | Description | |
---|---|---|
ActiveEntityMode | The entity mode in effect for this session. | |
CacheMode | The current cache mode. | |
Connection |
Gets the ADO.NET connection.
| |
DefaultReadOnly |
The read-only status for entities (and proxies) loaded into this Session.
| |
FlushMode |
Determines at which points Hibernate automatically flushes the session.
| |
IsConnected |
Is the ISession currently connected?
| |
IsOpen |
Is the ISession still open?
| |
SessionFactory |
Get the ISessionFactory that created this instance.
| |
Statistics | Get the statistics for this session. | |
Transaction |
Get the current Unit of Work and return the associated ITransaction object.
|