Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

HibernateTemplate Members

HibernateTemplate overview

Public Instance Constructors

HibernateTemplate Overloaded. Initializes a new instance of the HibernateTemplate class.

Public Instance Properties

AdoExceptionTranslator Set the ADO.NET exception translator for this instance. Applied to System.Data.Common.DbException (or provider specific exception type in .NET 1.1) thrown by callback code, be it direct DbException or wrapped Hibernate ADOExceptions. The default exception translator is either a ErrorCodeExceptionTranslator if a DbProvider is available, or a FalbackExceptionTranslator otherwise
AllowCreate Gets or sets if a new Session should be created when no transactional Session can be found for the current thread.
AlwaysUseNewSession Gets or sets a value indicating whether to always use a new Hibernate Session for this template.
CacheQueries Gets or sets a value indicating whether to cache all queries executed by this template.
CheckWriteOperations Gets or sets whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).
EntityInterceptor Gets or sets the entity interceptor that allows to inspect and change property values before writing to and reading from the database.
EntityInterceptorObjectName Set the object name of a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database.
ExposeNativeSession Set whether to expose the native Hibernate Session to IHibernateCallback code. Default is "false": a Session proxy will be returned, suppressing
close
calls and automatically applying query cache settings and transaction timeouts.
FetchSize Gets or sets the fetch size for this HibernateTemplate.
MaxResults Gets or sets the maximum number of rows for this HibernateTemplate.
ObjectFactory Set the object factory instance.
ProxyFactory Gets or sets the proxy factory.
QueryCacheRegion Gets or sets the name of the cache region for queries executed by this template.
SessionFactory Gets or sets the session factory that should be used to create NHibernate ISessions.
TemplateFlushMode Gets or sets the template flush mode.

Public Instance Methods

AfterPropertiesSet (inherited from HibernateAccessor) Ensure SessionFactory is not null
ApplyNamedParameterToQuery (inherited from HibernateAccessor) Apply the given name parameter to the given Query object.
CheckWriteOperationAllowed Check whether write operations are allowed on the given Session.
Clear Remove all objects from the Session cache, and cancel all pending saves, updates and deletes.
Contains Determines whether the given object is in the Session cache.
ConvertHibernateAccessException (inherited from HibernateAccessor) Convert the given HibernateException to an appropriate exception from the
org.springframework.dao
hierarchy. Will automatically detect wrapped ADO.NET Exceptions and convert them accordingly.
CreateSessionProxy Create a close-suppressing proxy for the given Hibernate Session. The proxy also prepares returned Query and Criteria objects.
DeleteOverloaded. Delete the given persistent instance.
DeleteAll Delete all given persistent instances.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
Evict Remove the given object from the Session cache.
ExecuteOverloaded. Execute the action specified by the given action object within a Session.
ExecuteFind Execute the specified action assuming that the result object is a List.
FindOverloaded. Execute a query for persistent instances.
FindByNamedParamOverloaded. Execute a query for persistent instances, binding one value to a named parameter in the query string.
FindByNamedQueryOverloaded. Execute a named query for persistent instances. A named query is defined in a Hibernate mapping file.
FindByNamedQueryAndNamedParamOverloaded. Execute a named query for persistent instances, binding one value to a named parameter in the query string. A named query is defined in a Hibernate mapping file.
FindByNamedQueryAndValueObject Execute a named query for persistent instances, binding the properties of the given object to named parameters in the query string. A named query is defined in a Hibernate mapping file.
FindByValueObject Execute a query for persistent instances, binding the properties of the given object to named parameters in the query string.
Flush Flush all pending saves, updates and deletes to the database.
GetOverloaded. Return the persistent instance of the given entity type with the given identifier, or
null
if not found.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
LoadOverloaded. Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found.
LoadAll Return all persistent instances of the given entity class. Note: Use queries or criteria for retrieving a specific subset.
Lock Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists (throwing an OptimisticLockingFailureException if not found).
PrepareCriteria (inherited from HibernateAccessor) Prepare the given Criteria object, applying cache settings and/or a transaction timeout.
PrepareQuery (inherited from HibernateAccessor) Prepare the given IQuery object, applying cache settings and/or a transaction timeout.
RefreshOverloaded. Re-read the state of the given persistent instance.
SaveOverloaded. Persist the given transient instance.
SaveOrUpdate Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?).
SaveOrUpdateAll Save or update all given persistent instances, according to its id (matching the configured "unsaved-value"?).
SaveOrUpdateCopy Save or update the contents of given persistent object, according to its id (matching the configured "unsaved-value"?). Will copy the contained fields to an already loaded instance with the same id, if appropriate.
ToString (inherited from Object)Returns a String that represents the current Object.
UpdateOverloaded. Update the given persistent instance.

Protected Instance Properties

Session (inherited from HibernateAccessor) Gets a Session for use by this template.

Protected Instance Methods

ApplyFlushMode (inherited from HibernateAccessor) Apply the flush mode that's been specified for this accessor to the given Session.
AreEqualFlushMode Compares if the flush mode enumerations, Spring's TemplateFlushMode and NHibernates FlushMode have equal settings.
ClearAction Delegate function that clears the session.
ConvertAdoAccessException (inherited from HibernateAccessor)Overloaded. Converts the ADO.NET access exception to an appropriate exception from the
org.springframework.dao
hierarchy. Can be overridden in subclasses.
Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
FlushIfNecessary (inherited from HibernateAccessor) Flush the given Hibernate Session if necessary.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

See Also

HibernateTemplate Class | Spring.Data.NHibernate Namespace