FileDocCategorySizeDatePackage
SessionImplementor.javaAPI DocHibernate 3.2.59441Thu Jun 15 00:21:06 BST 2006org.hibernate.engine

SessionImplementor

public interface SessionImplementor implements Serializable
Defines the internal contract between the Session and other parts of Hibernate such as implementors of Type or EntityPersister.
see
org.hibernate.Session the interface to the application
see
org.hibernate.impl.SessionImpl the actual implementation
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public voidafterScrollOperation()

public voidafterTransactionCompletion(boolean successful, org.hibernate.Transaction tx)
Notify the session that the transaction completed, so we no longer own the old locks. (Also we should release cache softlocks.) May be called multiple times during the transaction completion process. Also called after an autocommit, in which case the second argument is null.

public voidbeforeTransactionCompletion(org.hibernate.Transaction tx)
Notify the session that the transaction is about to complete

public java.lang.StringbestGuessEntityName(java.lang.Object object)
The best guess entity name for an entity not in an association

public java.sql.Connectionconnection()

public intexecuteNativeUpdate(org.hibernate.engine.query.sql.NativeSQLQuerySpecification specification, QueryParameters queryParameters)
Execute a native SQL update or delete query

public intexecuteUpdate(java.lang.String query, QueryParameters queryParameters)
Execute a HQL update or delete query

public voidflush()

public org.hibernate.jdbc.BatchergetBatcher()
Get the prepared statement Batcher for this session

public org.hibernate.CacheModegetCacheMode()

public java.io.SerializablegetContextEntityIdentifier(java.lang.Object object)
Return the identifier of the persistent object, or null if not associated with the session

public intgetDontFlushFromFind()

public java.util.MapgetEnabledFilters()
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
The currently enabled filters.

public org.hibernate.EntityModegetEntityMode()

public org.hibernate.persister.entity.EntityPersistergetEntityPersister(java.lang.String entityName, java.lang.Object object)
Get the EntityPersister for any instance

param
entityName optional entity name
param
object the entity instance

public java.lang.ObjectgetEntityUsingInterceptor(EntityKey key)
Get the entity instance associated with the given Key, calling the Interceptor if necessary

public SessionFactoryImplementorgetFactory()
Get the creating SessionFactoryImplementor

public java.lang.StringgetFetchProfile()

public org.hibernate.type.TypegetFilterParameterType(java.lang.String filterParameterName)
Retreive the type for a given filter parrameter.

param
filterParameterName The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.

public java.lang.ObjectgetFilterParameterValue(java.lang.String filterParameterName)
Retreive the currently set value for a filter parameter.

param
filterParameterName The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.
return
The filter parameter value.

public org.hibernate.FlushModegetFlushMode()

public org.hibernate.InterceptorgetInterceptor()
Retrieves the interceptor currently in use by this event source.

return
The interceptor.

public org.hibernate.jdbc.JDBCContextgetJDBCContext()

public org.hibernate.event.EventListenersgetListeners()
Retrieves the configured event listeners from this event source.

return
The configured event listeners.

public org.hibernate.QuerygetNamedQuery(java.lang.String name)
Get a Query instance for a named query or named native SQL query

public org.hibernate.QuerygetNamedSQLQuery(java.lang.String name)
Get a Query instance for a named native SQL query

public PersistenceContextgetPersistenceContext()
Get the persistence context for this session

public longgetTimestamp()
System time before the start of the transaction

public java.lang.StringguessEntityName(java.lang.Object entity)
The guessed entity name for an entity not in an association

public java.lang.ObjectimmediateLoad(java.lang.String entityName, java.io.Serializable id)
Load an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.

public voidinitializeCollection(org.hibernate.collection.PersistentCollection collection, boolean writing)
Initialize the collection (if not already initialized)

public java.lang.Objectinstantiate(java.lang.String entityName, java.io.Serializable id)
Instantiate the entity class, initializing with the given identifier

public java.lang.ObjectinternalLoad(java.lang.String entityName, java.io.Serializable id, boolean eager, boolean nullable)
Load an instance without checking if it was deleted. When nullable is disabled this method may create a new proxy or return an existing proxy; if it does not exist, throw an exception. When nullable is enabled, the method does not create new proxies (but might return an existing proxy); if it does not exist, return null. When eager is enabled, the object is eagerly fetched

public booleanisClosed()
Determine whether the session is closed. Provided seperately from {@link #isOpen()} as this method does not attempt any JTA synch registration, where as {@link #isOpen()} does; which makes this one nicer to use for most internal purposes.

return
True if the session is closed; false otherwise.

public booleanisConnected()

public booleanisEventSource()

public booleanisOpen()

public booleanisTransactionInProgress()
Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?

public java.util.Iteratoriterate(java.lang.String query, QueryParameters queryParameters)
Execute an iterate() query

public java.util.IteratoriterateFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters)
Iterate a filter

public java.util.Listlist(java.lang.String query, QueryParameters queryParameters)
Execute a find() query

public java.util.Listlist(org.hibernate.impl.CriteriaImpl criteria)
Execute a criteria query

public java.util.Listlist(org.hibernate.engine.query.sql.NativeSQLQuerySpecification spec, QueryParameters queryParameters)
Execute a native SQL query, and return the results as a fully built list.

param
spec The specification of the native SQL query to execute.
param
queryParameters The parameters by which to perform the execution.
return
The result list.
throws
HibernateException

public java.util.ListlistCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, QueryParameters queryParameters)
Execute an SQL Query

public java.util.ListlistFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters)
Execute a filter

public org.hibernate.ScrollableResultsscroll(java.lang.String query, QueryParameters queryParameters)
Execute a scroll() query

public org.hibernate.ScrollableResultsscroll(org.hibernate.impl.CriteriaImpl criteria, org.hibernate.ScrollMode scrollMode)
Execute a criteria query

public org.hibernate.ScrollableResultsscroll(org.hibernate.engine.query.sql.NativeSQLQuerySpecification spec, QueryParameters queryParameters)
Execute a native SQL query, and return the results as a scrollable result.

param
spec The specification of the native SQL query to execute.
param
queryParameters The parameters by which to perform the execution.
return
The resulting scrollable result.
throws
HibernateException

public org.hibernate.ScrollableResultsscrollCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, QueryParameters queryParameters)
Execute an SQL Query

public voidsetAutoClear(boolean enabled)
Enable/disable automatic cache clearing from after transaction completion (for EJB3)

public voidsetCacheMode(org.hibernate.CacheMode cm)

public voidsetFetchProfile(java.lang.String name)

public voidsetFlushMode(org.hibernate.FlushMode fm)