public abstract class AbstractDelegateSessionImplementor extends Object implements SessionImplementor
LobCreationContext.Callback<T>
Modifier and Type | Field and Description |
---|---|
protected SessionImplementor |
delegate |
Constructor and Description |
---|
AbstractDelegateSessionImplementor(SessionImplementor delegate) |
Modifier and Type | Method and Description |
---|---|
void |
afterScrollOperation() |
void |
applyNonFlushedChanges(NonFlushedChanges nonFlushedChanges)
Apply non-flushed changes from a different session to this session.
|
String |
bestGuessEntityName(Object object)
The best guess entity name for an entity not in an association
|
Connection |
connection() |
void |
disableTransactionAutoJoin()
Disable automatic transaction joining.
|
abstract Object |
doImmediateLoad(String entityName) |
<T> T |
execute(LobCreationContext.Callback<T> callback)
Execute the given callback, making sure it has access to a viable JDBC
Connection . |
int |
executeNativeUpdate(NativeSQLQuerySpecification specification,
QueryParameters queryParameters)
Execute a native SQL update or delete query
|
int |
executeUpdate(String query,
QueryParameters queryParameters)
Execute a HQL update or delete query
|
void |
flush() |
CacheKey |
generateCacheKey(Serializable id,
Type type,
String entityOrRoleName)
Hide the changing requirements of cache key creation.
|
EntityKey |
generateEntityKey(Serializable id,
EntityPersister persister)
Hide the changing requirements of entity key creation
|
CacheMode |
getCacheMode() |
Serializable |
getContextEntityIdentifier(Object object)
Return the identifier of the persistent object, or null if
not associated with the session
|
int |
getDontFlushFromFind() |
Map |
getEnabledFilters()
Return the currently enabled filters.
|
EntityPersister |
getEntityPersister(String entityName,
Object object)
Get the EntityPersister for any instance
|
Object |
getEntityUsingInterceptor(EntityKey key)
Get the entity instance associated with the given Key,
calling the Interceptor if necessary
|
SessionFactoryImplementor |
getFactory()
Get the creating SessionFactoryImplementor
|
String |
getFetchProfile()
Get the internal fetch profile currently associated with this session.
|
Type |
getFilterParameterType(String filterParameterName)
Retreive the type for a given filter parrameter.
|
Object |
getFilterParameterValue(String filterParameterName)
Retreive the currently set value for a filter parameter.
|
FlushMode |
getFlushMode() |
Interceptor |
getInterceptor()
Retrieves the interceptor currently in use by this event source.
|
JdbcConnectionAccess |
getJdbcConnectionAccess()
Provides access to JDBC connections
|
LoadQueryInfluencers |
getLoadQueryInfluencers()
Get the load query influencers associated with this session.
|
Query |
getNamedQuery(String name)
Get a Query instance for a named query or named native SQL query
|
Query |
getNamedSQLQuery(String name)
Get a Query instance for a named native SQL query
|
NonFlushedChanges |
getNonFlushedChanges()
Return changes to this session that have not been flushed yet.
|
PersistenceContext |
getPersistenceContext()
Get the persistence context for this session
|
String |
getTenantIdentifier()
Match te method on
Session and StatelessSession |
long |
getTimestamp()
System time before the start of the transaction
|
TransactionCoordinator |
getTransactionCoordinator()
Retrieve access to the session's transaction coordinator.
|
String |
guessEntityName(Object entity)
The guessed entity name for an entity not in an association
|
Object |
immediateLoad(String entityName,
Serializable id)
Load an instance immediately.
|
void |
initializeCollection(PersistentCollection collection,
boolean writing)
Initialize the collection (if not already initialized)
|
Object |
instantiate(String entityName,
Serializable id)
Instantiate the entity class, initializing with the given identifier
|
Object |
internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable)
Load an instance without checking if it was deleted.
|
boolean |
isClosed()
Determine whether the session is closed.
|
boolean |
isConnected() |
boolean |
isEventSource() |
boolean |
isOpen() |
boolean |
isTransactionInProgress()
Does this Session have an active Hibernate transaction
or is there a JTA transaction in progress?
|
Iterator |
iterate(String query,
QueryParameters queryParameters)
Execute an iterate() query
|
Iterator |
iterateFilter(Object collection,
String filter,
QueryParameters queryParameters)
Iterate a filter
|
List |
list(CriteriaImpl criteria)
Execute a criteria query
|
List |
list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a fully built list.
|
List |
list(String query,
QueryParameters queryParameters)
Execute a find() query
|
List |
listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
Execute an SQL Query
|
List |
listFilter(Object collection,
String filter,
QueryParameters queryParameters)
Execute a filter
|
ScrollableResults |
scroll(CriteriaImpl criteria,
ScrollMode scrollMode)
Execute a criteria query
|
ScrollableResults |
scroll(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a scrollable result.
|
ScrollableResults |
scroll(String query,
QueryParameters queryParameters)
Execute a scroll() query
|
ScrollableResults |
scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
Execute an SQL Query
|
void |
setAutoClear(boolean enabled)
Enable/disable automatic cache clearing from after transaction
completion (for EJB3)
|
void |
setCacheMode(CacheMode cm) |
void |
setFetchProfile(String name)
Set the current internal fetch profile for this session.
|
void |
setFlushMode(FlushMode fm) |
protected SessionImplementor delegate
public AbstractDelegateSessionImplementor(SessionImplementor delegate)
public Object immediateLoad(String entityName, Serializable id) throws HibernateException
SessionImplementor
immediateLoad
in interface SessionImplementor
HibernateException
public String getTenantIdentifier()
SessionImplementor
Session
and StatelessSession
getTenantIdentifier
in interface SessionImplementor
public JdbcConnectionAccess getJdbcConnectionAccess()
SessionImplementor
getJdbcConnectionAccess
in interface SessionImplementor
public EntityKey generateEntityKey(Serializable id, EntityPersister persister)
SessionImplementor
generateEntityKey
in interface SessionImplementor
id
- The entity idpersister
- The entity persisterpublic CacheKey generateCacheKey(Serializable id, Type type, String entityOrRoleName)
SessionImplementor
generateCacheKey
in interface SessionImplementor
id
- The entity identifier or collection key.type
- The typeentityOrRoleName
- The entity name or collection role.public <T> T execute(LobCreationContext.Callback<T> callback)
LobCreationContext
Connection
.execute
in interface LobCreationContext
callback
- The callback to execute .public LoadQueryInfluencers getLoadQueryInfluencers()
SessionImplementor
getLoadQueryInfluencers
in interface SessionImplementor
public Interceptor getInterceptor()
SessionImplementor
getInterceptor
in interface SessionImplementor
public void setAutoClear(boolean enabled)
SessionImplementor
setAutoClear
in interface SessionImplementor
public void disableTransactionAutoJoin()
SessionImplementor
Synchronization
).
JPA however defines an explicit join transaction operation.
See javax.persistence.EntityManager#joinTransactiondisableTransactionAutoJoin
in interface SessionImplementor
public boolean isTransactionInProgress()
SessionImplementor
isTransactionInProgress
in interface SessionImplementor
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
SessionImplementor
initializeCollection
in interface SessionImplementor
HibernateException
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
SessionImplementor
internalLoad
in interface SessionImplementor
HibernateException
public long getTimestamp()
SessionImplementor
getTimestamp
in interface SessionImplementor
public SessionFactoryImplementor getFactory()
SessionImplementor
getFactory
in interface SessionImplementor
public List list(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementor
list
in interface SessionImplementor
HibernateException
public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementor
iterate
in interface SessionImplementor
HibernateException
public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementor
scroll
in interface SessionImplementor
HibernateException
public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode)
SessionImplementor
scroll
in interface SessionImplementor
public List list(CriteriaImpl criteria)
SessionImplementor
list
in interface SessionImplementor
public List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SessionImplementor
listFilter
in interface SessionImplementor
HibernateException
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SessionImplementor
iterateFilter
in interface SessionImplementor
HibernateException
public EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
SessionImplementor
getEntityPersister
in interface SessionImplementor
entityName
- optional entity nameobject
- the entity instanceHibernateException
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
SessionImplementor
getEntityUsingInterceptor
in interface SessionImplementor
HibernateException
public Serializable getContextEntityIdentifier(Object object)
SessionImplementor
getContextEntityIdentifier
in interface SessionImplementor
public String bestGuessEntityName(Object object)
SessionImplementor
bestGuessEntityName
in interface SessionImplementor
public String guessEntityName(Object entity) throws HibernateException
SessionImplementor
guessEntityName
in interface SessionImplementor
HibernateException
public Object instantiate(String entityName, Serializable id) throws HibernateException
SessionImplementor
instantiate
in interface SessionImplementor
HibernateException
public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SessionImplementor
listCustomQuery
in interface SessionImplementor
HibernateException
public ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SessionImplementor
scrollCustomQuery
in interface SessionImplementor
HibernateException
public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
SessionImplementor
list
in interface SessionImplementor
spec
- The specification of the native SQL query to execute.queryParameters
- The parameters by which to perform the execution.HibernateException
public ScrollableResults scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
SessionImplementor
scroll
in interface SessionImplementor
spec
- The specification of the native SQL query to execute.queryParameters
- The parameters by which to perform the execution.HibernateException
public Object getFilterParameterValue(String filterParameterName)
SessionImplementor
getFilterParameterValue
in interface SessionImplementor
filterParameterName
- The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.public Type getFilterParameterType(String filterParameterName)
SessionImplementor
getFilterParameterType
in interface SessionImplementor
filterParameterName
- The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.public Map getEnabledFilters()
SessionImplementor
FilterImpl
instance.getEnabledFilters
in interface SessionImplementor
public int getDontFlushFromFind()
getDontFlushFromFind
in interface SessionImplementor
public PersistenceContext getPersistenceContext()
SessionImplementor
getPersistenceContext
in interface SessionImplementor
public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementor
executeUpdate
in interface SessionImplementor
HibernateException
public int executeNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters) throws HibernateException
SessionImplementor
executeNativeUpdate
in interface SessionImplementor
HibernateException
public NonFlushedChanges getNonFlushedChanges() throws HibernateException
SessionImplementor
getNonFlushedChanges
in interface SessionImplementor
HibernateException
public void applyNonFlushedChanges(NonFlushedChanges nonFlushedChanges) throws HibernateException
SessionImplementor
applyNonFlushedChanges
in interface SessionImplementor
nonFlushedChanges
- the non-flushed changesHibernateException
public CacheMode getCacheMode()
getCacheMode
in interface SessionImplementor
public void setCacheMode(CacheMode cm)
setCacheMode
in interface SessionImplementor
public boolean isOpen()
isOpen
in interface SessionImplementor
public boolean isConnected()
isConnected
in interface SessionImplementor
public FlushMode getFlushMode()
getFlushMode
in interface SessionImplementor
public void setFlushMode(FlushMode fm)
setFlushMode
in interface SessionImplementor
public Connection connection()
connection
in interface SessionImplementor
public void flush()
flush
in interface SessionImplementor
public Query getNamedQuery(String name)
SessionImplementor
getNamedQuery
in interface SessionImplementor
public Query getNamedSQLQuery(String name)
SessionImplementor
getNamedSQLQuery
in interface SessionImplementor
public boolean isEventSource()
isEventSource
in interface SessionImplementor
public void afterScrollOperation()
afterScrollOperation
in interface SessionImplementor
public void setFetchProfile(String name)
SessionImplementor
setFetchProfile
in interface SessionImplementor
name
- The internal fetch profile name to usepublic String getFetchProfile()
SessionImplementor
getFetchProfile
in interface SessionImplementor
public TransactionCoordinator getTransactionCoordinator()
SessionImplementor
getTransactionCoordinator
in interface SessionImplementor
public boolean isClosed()
SessionImplementor
SessionImplementor.isOpen()
as this method does not attempt any JTA synchronization
registration, where as SessionImplementor.isOpen()
does; which makes this one
nicer to use for most internal purposes.isClosed
in interface SessionImplementor
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.