|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.engine.spi.SessionDelegatorBaseImpl
public class SessionDelegatorBaseImpl
This class is meant to be extended.
Wraps and delegates all methods to a SessionImplementor and
a Session. This is useful for custom implementations of this
API so that only some methods need to be overriden
(Used by Hibernate Search).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext |
|---|
LobCreationContext.Callback<T> |
| Nested classes/interfaces inherited from interface org.hibernate.Session |
|---|
Session.LockRequest |
| Field Summary | |
|---|---|
protected Session |
session
|
protected SessionImplementor |
sessionImplementor
|
| Constructor Summary | |
|---|---|
SessionDelegatorBaseImpl(SessionImplementor sessionImplementor,
Session session)
|
|
| Method Summary | ||
|---|---|---|
void |
addEventListeners(SessionEventListener... listeners)
Add one or more listeners to the Session |
|
void |
afterScrollOperation()
|
|
Transaction |
beginTransaction()
Begin a unit of work and return the associated Transaction object. |
|
String |
bestGuessEntityName(Object object)
The best guess entity name for an entity not in an association |
|
Session.LockRequest |
buildLockRequest(LockOptions lockOptions)
Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope. |
|
IdentifierLoadAccess |
byId(Class entityClass)
Create an IdentifierLoadAccess instance to retrieve the specified entity by
primary key. |
|
IdentifierLoadAccess |
byId(String entityName)
Create an IdentifierLoadAccess instance to retrieve the specified entity type by
primary key. |
|
NaturalIdLoadAccess |
byNaturalId(Class entityClass)
Create an NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
|
NaturalIdLoadAccess |
byNaturalId(String entityName)
Create an NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
|
SimpleNaturalIdLoadAccess |
bySimpleNaturalId(Class entityClass)
Create an SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its simple (single attribute) natural id. |
|
SimpleNaturalIdLoadAccess |
bySimpleNaturalId(String entityName)
Create an SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
|
void |
cancelQuery()
Cancel the execution of the current query. |
|
void |
clear()
Completely clear the session. |
|
Connection |
close()
End the session by releasing the JDBC connection and cleaning up. |
|
Connection |
connection()
|
|
boolean |
contains(Object object)
Check if this instance is associated with this Session. |
|
Criteria |
createCriteria(Class persistentClass)
Create Criteria instance for the given class (entity or subclasses/implementors) |
|
Criteria |
createCriteria(Class persistentClass,
String alias)
Create Criteria instance for the given class (entity or subclasses/implementors), using a specific
alias. |
|
Criteria |
createCriteria(String entityName)
Create Criteria instance for the given entity name. |
|
Criteria |
createCriteria(String entityName,
String alias)
Create Criteria instance for the given entity name, using a specific alias. |
|
Query |
createFilter(Object collection,
String queryString)
Create a Query instance for the given collection and filter string. |
|
Query |
createQuery(String queryString)
Create a Query instance for the given HQL query string. |
|
SQLQuery |
createSQLQuery(String queryString)
Create a SQLQuery instance for the given SQL query string. |
|
void |
delete(Object object)
Remove a persistent instance from the datastore. |
|
void |
delete(String entityName,
Object object)
Remove a persistent instance from the datastore. |
|
void |
disableFetchProfile(String name)
Disable a particular fetch profile on this session. |
|
void |
disableFilter(String filterName)
Disable the named filter for the current session. |
|
void |
disableTransactionAutoJoin()
Disable automatic transaction joining. |
|
Connection |
disconnect()
Disconnect the session from its underlying JDBC connection. |
|
|
doReturningWork(ReturningWork<T> work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session. |
|
void |
doWork(Work work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session. |
|
void |
enableFetchProfile(String name)
Enable a particular fetch profile on this session. |
|
Filter |
enableFilter(String filterName)
Enable the named filter for this current session. |
|
void |
evict(Object object)
Remove this instance from the session cache. |
|
|
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()
Force this session to 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 |
|
Object |
get(Class clazz,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
|
Object |
get(Class clazz,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
|
Object |
get(Class clazz,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
|
Object |
get(String entityName,
Serializable id)
Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. |
|
Object |
get(String entityName,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
|
Object |
get(String entityName,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
|
CacheMode |
getCacheMode()
Get the current cache mode. |
|
Serializable |
getContextEntityIdentifier(Object object)
Return the identifier of the persistent object, or null if not associated with the session |
|
LockMode |
getCurrentLockMode(Object object)
Determine the current lock mode of the given object. |
|
int |
getDontFlushFromFind()
|
|
Filter |
getEnabledFilter(String filterName)
Retrieve a currently enabled filter by name. |
|
Map |
getEnabledFilters()
Return the currently enabled filters. |
|
String |
getEntityName(Object object)
Return the entity name for a persistent entity |
|
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 |
|
SessionEventListenerManager |
getEventListenerManager()
|
|
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()
Get the current flush mode for this session. |
|
Serializable |
getIdentifier(Object object)
Return the identifier value of the given entity as associated with this session. |
|
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. |
|
LobHelper |
getLobHelper()
Retrieve this session's helper/delegate for creating LOB instances. |
|
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 |
|
PersistenceContext |
getPersistenceContext()
Get the persistence context for this session |
|
SessionFactory |
getSessionFactory()
Get the session factory which created this session. |
|
SessionStatistics |
getStatistics()
Get the statistics for this session. |
|
String |
getTenantIdentifier()
Match te method on Session and StatelessSession |
|
long |
getTimestamp()
System time before the start of the transaction |
|
Transaction |
getTransaction()
Get the Transaction instance associated with this session. |
|
TransactionCoordinator |
getTransactionCoordinator()
Retrieve access to the session's transaction coordinator. |
|
TypeHelper |
getTypeHelper()
Convenience access to the TypeHelper associated with this session's SessionFactory. |
|
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()
Check if the session is currently connected. |
|
boolean |
isDefaultReadOnly()
Will entities and proxies that are loaded into this session be made read-only by default? To determine the read-only/modifiable setting for a particular entity or proxy: |
|
boolean |
isDirty()
Does this session contain any changes which must be synchronized with the database? In other words, would any DML operations be executed if we flushed this session? |
|
boolean |
isEventSource()
|
|
boolean |
isFetchProfileEnabled(String name)
Is a particular fetch profile enabled on this session? |
|
boolean |
isOpen()
Check if the session is still open. |
|
boolean |
isReadOnly(Object entityOrProxy)
Is the specified entity or proxy read-only? To get the default read-only/modifiable setting used for entities and proxies that are loaded into the session: |
|
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(Criteria 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 |
|
Object |
load(Class theClass,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
|
Object |
load(Class theClass,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
|
Object |
load(Class theClass,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
|
void |
load(Object object,
Serializable id)
Read the persistent state associated with the given identifier into the given transient instance. |
|
Object |
load(String entityName,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
|
Object |
load(String entityName,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
|
Object |
load(String entityName,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
|
void |
lock(Object object,
LockMode lockMode)
Obtain the specified lock level upon the given object. |
|
void |
lock(String entityName,
Object object,
LockMode lockMode)
Obtain the specified lock level upon the given object. |
|
Object |
merge(Object object)
Copy the state of the given object onto the persistent object with the same identifier. |
|
Object |
merge(String entityName,
Object object)
Copy the state of the given object onto the persistent object with the same identifier. |
|
void |
persist(Object object)
Make a transient instance persistent. |
|
void |
persist(String entityName,
Object object)
Make a transient instance persistent. |
|
void |
reconnect(Connection connection)
Reconnect to the given JDBC connection. |
|
void |
refresh(Object object)
Re-read the state of the given instance from the underlying database. |
|
void |
refresh(Object object,
LockMode lockMode)
Re-read the state of the given instance from the underlying database, with the given LockMode. |
|
void |
refresh(Object object,
LockOptions lockOptions)
Re-read the state of the given instance from the underlying database, with the given LockMode. |
|
void |
refresh(String entityName,
Object object)
Re-read the state of the given instance from the underlying database. |
|
void |
refresh(String entityName,
Object object,
LockOptions lockOptions)
Re-read the state of the given instance from the underlying database, with the given LockMode. |
|
void |
replicate(Object object,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value. |
|
void |
replicate(String entityName,
Object object,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value. |
|
Serializable |
save(Object object)
Persist the given transient instance, first assigning a generated identifier. |
|
Serializable |
save(String entityName,
Object object)
Persist the given transient instance, first assigning a generated identifier. |
|
void |
saveOrUpdate(Object object)
Either Session.save(Object) or Session.update(Object) the given
instance, depending upon resolution of the unsaved-value checks (see the
manual for discussion of unsaved-value checking). |
|
void |
saveOrUpdate(String entityName,
Object object)
Either Session.save(String, Object) or Session.update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking). |
|
ScrollableResults |
scroll(Criteria 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 |
|
SharedSessionBuilder |
sessionWithOptions()
Obtain a Session builder with the ability to grab certain information from this session. |
|
void |
setAutoClear(boolean enabled)
Enable/disable automatic cache clearing from after transaction completion (for EJB3) |
|
void |
setCacheMode(CacheMode cm)
Set the cache mode. |
|
void |
setDefaultReadOnly(boolean readOnly)
Change the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode. |
|
void |
setFetchProfile(String name)
Set the current internal fetch profile for this session. |
|
void |
setFlushMode(FlushMode fm)
Set the flush mode for this session. |
|
void |
setReadOnly(Object entityOrProxy,
boolean readOnly)
Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. |
|
void |
update(Object object)
Update the persistent instance with the identifier of the given detached instance. |
|
void |
update(String entityName,
Object object)
Update the persistent instance with the identifier of the given detached instance. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final SessionImplementor sessionImplementor
protected final Session session
| Constructor Detail |
|---|
public SessionDelegatorBaseImpl(SessionImplementor sessionImplementor,
Session session)
| Method Detail |
|---|
public <T> T execute(LobCreationContext.Callback<T> callback)
LobCreationContextConnection.
execute in interface LobCreationContextcallback - The callback to execute .
public String getTenantIdentifier()
SessionImplementorSession and StatelessSession
getTenantIdentifier in interface SessionImplementorgetTenantIdentifier in interface SharedSessionContractpublic JdbcConnectionAccess getJdbcConnectionAccess()
SessionImplementor
getJdbcConnectionAccess in interface SessionImplementor
public EntityKey generateEntityKey(Serializable id,
EntityPersister persister)
SessionImplementor
generateEntityKey in interface SessionImplementorid - The entity idpersister - The entity persister
public CacheKey generateCacheKey(Serializable id,
Type type,
String entityOrRoleName)
SessionImplementor
generateCacheKey in interface SessionImplementorid - The entity identifier or collection key.type - The typeentityOrRoleName - The entity name or collection role.
public Interceptor getInterceptor()
SessionImplementor
getInterceptor in interface SessionImplementorpublic void setAutoClear(boolean enabled)
SessionImplementor
setAutoClear in interface SessionImplementorpublic void disableTransactionAutoJoin()
SessionImplementorSynchronization).
JPA however defines an explicit join transaction operation.
See javax.persistence.EntityManager#joinTransaction
disableTransactionAutoJoin in interface SessionImplementorpublic boolean isTransactionInProgress()
SessionImplementor
isTransactionInProgress in interface SessionImplementor
public void initializeCollection(PersistentCollection collection,
boolean writing)
throws HibernateException
SessionImplementor
initializeCollection in interface SessionImplementorHibernateException
public Object internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable)
throws HibernateException
SessionImplementor
internalLoad in interface SessionImplementorHibernateException
public Object immediateLoad(String entityName,
Serializable id)
throws HibernateException
SessionImplementor
immediateLoad in interface SessionImplementorHibernateExceptionpublic long getTimestamp()
SessionImplementor
getTimestamp in interface SessionImplementorpublic SessionFactoryImplementor getFactory()
SessionImplementor
getFactory in interface SessionImplementor
public List list(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
list in interface SessionImplementorHibernateException
public Iterator iterate(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
iterate in interface SessionImplementorHibernateException
public ScrollableResults scroll(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scroll in interface SessionImplementorHibernateException
public ScrollableResults scroll(Criteria criteria,
ScrollMode scrollMode)
SessionImplementor
scroll in interface SessionImplementorpublic List list(Criteria criteria)
SessionImplementor
list in interface SessionImplementor
public List listFilter(Object collection,
String filter,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
listFilter in interface SessionImplementorHibernateException
public Iterator iterateFilter(Object collection,
String filter,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
iterateFilter in interface SessionImplementorHibernateException
public EntityPersister getEntityPersister(String entityName,
Object object)
throws HibernateException
SessionImplementor
getEntityPersister in interface SessionImplementorentityName - optional entity nameobject - the entity instance
HibernateException
public Object getEntityUsingInterceptor(EntityKey key)
throws HibernateException
SessionImplementor
getEntityUsingInterceptor in interface SessionImplementorHibernateExceptionpublic Serializable getContextEntityIdentifier(Object object)
SessionImplementor
getContextEntityIdentifier in interface SessionImplementorpublic String bestGuessEntityName(Object object)
SessionImplementor
bestGuessEntityName in interface SessionImplementor
public String guessEntityName(Object entity)
throws HibernateException
SessionImplementor
guessEntityName in interface SessionImplementorHibernateException
public Object instantiate(String entityName,
Serializable id)
throws HibernateException
SessionImplementor
instantiate in interface SessionImplementorHibernateException
public List listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
listCustomQuery in interface SessionImplementorHibernateException
public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scrollCustomQuery in interface SessionImplementorHibernateException
public List list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
list in interface SessionImplementorspec - 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 SessionImplementorspec - The specification of the native SQL query to execute.queryParameters - The parameters by which to perform the execution.
HibernateExceptionpublic Object getFilterParameterValue(String filterParameterName)
SessionImplementor
getFilterParameterValue in interface SessionImplementorfilterParameterName - The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.
public Type getFilterParameterType(String filterParameterName)
SessionImplementor
getFilterParameterType in interface SessionImplementorfilterParameterName - The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.
public Map getEnabledFilters()
SessionImplementorFilterImpl
instance.
getEnabledFilters in interface SessionImplementorpublic int getDontFlushFromFind()
getDontFlushFromFind in interface SessionImplementorpublic PersistenceContext getPersistenceContext()
SessionImplementor
getPersistenceContext in interface SessionImplementor
public int executeUpdate(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
executeUpdate in interface SessionImplementorHibernateException
public int executeNativeUpdate(NativeSQLQuerySpecification specification,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
executeNativeUpdate in interface SessionImplementorHibernateExceptionpublic CacheMode getCacheMode()
Session
getCacheMode in interface SessionImplementorgetCacheMode in interface Sessionpublic void setCacheMode(CacheMode cm)
Session
setCacheMode in interface SessionImplementorsetCacheMode in interface Sessioncm - The new cache mode.public boolean isOpen()
Session
isOpen in interface SessionImplementorisOpen in interface Sessionpublic boolean isConnected()
Session
isConnected in interface SessionImplementorisConnected in interface Sessionpublic FlushMode getFlushMode()
Session
getFlushMode in interface SessionImplementorgetFlushMode in interface Sessionpublic void setFlushMode(FlushMode fm)
SessionFlushMode.MANUAL at the start of the session (in
order to achieve some extra performance).
setFlushMode in interface SessionImplementorsetFlushMode in interface Sessionfm - the new flush modeFlushModepublic Connection connection()
connection in interface SessionImplementorpublic void flush()
SessionSession.setFlushMode(FlushMode),
Transaction.commit() calls this method).
Flushing is the process of synchronizing the underlying persistent
store with persistable state held in memory.
flush in interface SessionImplementorflush in interface Sessionpublic Query getNamedQuery(String name)
SessionImplementor
getNamedQuery in interface SessionImplementorgetNamedQuery in interface SharedSessionContractname - the name of a query defined externally
public Query getNamedSQLQuery(String name)
SessionImplementor
getNamedSQLQuery in interface SessionImplementorpublic boolean isEventSource()
isEventSource in interface SessionImplementorpublic void afterScrollOperation()
afterScrollOperation in interface SessionImplementorpublic String getFetchProfile()
SessionImplementor
getFetchProfile in interface SessionImplementorpublic void setFetchProfile(String name)
SessionImplementor
setFetchProfile in interface SessionImplementorname - The internal fetch profile name to usepublic TransactionCoordinator getTransactionCoordinator()
SessionImplementor
getTransactionCoordinator in interface SessionImplementorpublic boolean isClosed()
SessionImplementorSessionImplementor.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 SessionImplementorpublic LoadQueryInfluencers getLoadQueryInfluencers()
SessionImplementor
getLoadQueryInfluencers in interface SessionImplementorpublic SessionEventListenerManager getEventListenerManager()
getEventListenerManager in interface SessionImplementorpublic Transaction beginTransaction()
SharedSessionContractTransaction object. If a new underlying transaction is
required, begin the transaction. Otherwise continue the new work in the context of the existing underlying
transaction.
beginTransaction in interface SharedSessionContractSharedSessionContract.getTransaction()public Transaction getTransaction()
SharedSessionContractTransaction instance associated with this session. The concrete type of the returned
Transaction object is determined by the hibernate.transaction_factory property.
getTransaction in interface SharedSessionContractpublic Query createQuery(String queryString)
SharedSessionContractQuery instance for the given HQL query string.
createQuery in interface SharedSessionContractqueryString - The HQL query
public SQLQuery createSQLQuery(String queryString)
SharedSessionContractSQLQuery instance for the given SQL query string.
createSQLQuery in interface SharedSessionContractqueryString - The SQL query
public Criteria createCriteria(Class persistentClass)
SharedSessionContractCriteria instance for the given class (entity or subclasses/implementors)
createCriteria in interface SharedSessionContractpersistentClass - The class, which is an entity, or has entity subclasses/implementors
public Criteria createCriteria(Class persistentClass,
String alias)
SharedSessionContractCriteria instance for the given class (entity or subclasses/implementors), using a specific
alias.
createCriteria in interface SharedSessionContractpersistentClass - The class, which is an entity, or has entity subclasses/implementorsalias - The alias to use
public Criteria createCriteria(String entityName)
SharedSessionContractCriteria instance for the given entity name.
createCriteria in interface SharedSessionContractentityName - The entity name
public Criteria createCriteria(String entityName,
String alias)
SharedSessionContractCriteria instance for the given entity name, using a specific alias.
createCriteria in interface SharedSessionContractentityName - The entity namealias - The alias to use
public SharedSessionBuilder sessionWithOptions()
SessionSession builder with the ability to grab certain information from this session.
sessionWithOptions in interface Sessionpublic SessionFactory getSessionFactory()
Session
getSessionFactory in interface SessionSessionFactory
public Connection close()
throws HibernateException
SessionSession.disconnect() it.
close in interface SessionHibernateException - Indicates problems cleaning up.
public void cancelQuery()
throws HibernateException
Session
cancelQuery in interface SessionHibernateException - There was a problem canceling the query
public boolean isDirty()
throws HibernateException
Session
isDirty in interface SessionHibernateException - could not perform dirtying checkingpublic boolean isDefaultReadOnly()
Session
isDefaultReadOnly in interface SessionSession.isReadOnly(Object)public void setDefaultReadOnly(boolean readOnly)
Session
setDefaultReadOnly in interface SessionreadOnly - true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiableTo override this session's read-only/modifiable setting for entities
and proxies loaded by a Query:,
Query.setReadOnly(boolean)public Serializable getIdentifier(Object object)
Session
getIdentifier in interface Sessionobject - a persistent instance
public boolean contains(Object object)
Session
contains in interface Sessionobject - an instance of a persistent class
public void evict(Object object)
Session
evict in interface Sessionobject - The entity to evict
public Object load(Class theClass,
Serializable id,
LockMode lockMode)
Session
load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock level
public Object load(Class theClass,
Serializable id,
LockOptions lockOptions)
Session
load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the classlockOptions - contains the lock level
public Object load(String entityName,
Serializable id,
LockMode lockMode)
Session
load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock level
public Object load(String entityName,
Serializable id,
LockOptions lockOptions)
Session
load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the classlockOptions - contains the lock level
public Object load(Class theClass,
Serializable id)
Session
load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the class
public Object load(String entityName,
Serializable id)
Session
load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the class
public void load(Object object,
Serializable id)
Session
load in interface Sessionobject - an "empty" instance of the persistent classid - a valid identifier of an existing persistent instance of the class
public void replicate(Object object,
ReplicationMode replicationMode)
Sessioncascade="replicate"
replicate in interface Sessionobject - a detached instance of a persistent classreplicationMode - The replication mode to use
public void replicate(String entityName,
Object object,
ReplicationMode replicationMode)
Sessioncascade="replicate"
replicate in interface SessionentityName - The entity nameobject - a detached instance of a persistent classreplicationMode - The replication mode to usepublic Serializable save(Object object)
Sessioncascade="save-update"
save in interface Sessionobject - a transient instance of a persistent class
public Serializable save(String entityName,
Object object)
Sessioncascade="save-update"
save in interface SessionentityName - The entity nameobject - a transient instance of a persistent class
public void saveOrUpdate(Object object)
SessionSession.save(Object) or Session.update(Object) the given
instance, depending upon resolution of the unsaved-value checks (see the
manual for discussion of unsaved-value checking).
This operation cascades to associated instances if the association is mapped
with cascade="save-update"
saveOrUpdate in interface Sessionobject - a transient or detached instance containing new or updated stateSession.save(java.lang.Object),
Session.update(Object object)
public void saveOrUpdate(String entityName,
Object object)
SessionSession.save(String, Object) or Session.update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking).
This operation cascades to associated instances if the association is mapped
with cascade="save-update"
saveOrUpdate in interface SessionentityName - The entity nameobject - a transient or detached instance containing new or updated stateSession.save(String,Object),
Session.update(String,Object)public void update(Object object)
Sessioncascade="save-update"
update in interface Sessionobject - a detached instance containing updated state
public void update(String entityName,
Object object)
Sessioncascade="save-update"
update in interface SessionentityName - The entity nameobject - a detached instance containing updated statepublic Object merge(Object object)
Sessioncascade="merge"
The semantics of this method are defined by JSR-220.
merge in interface Sessionobject - a detached instance with state to be copied
public Object merge(String entityName,
Object object)
Sessioncascade="merge"
The semantics of this method are defined by JSR-220.
merge in interface SessionentityName - The entity nameobject - a detached instance with state to be copied
public void persist(Object object)
Sessioncascade="persist"
The semantics of this method are defined by JSR-220.
persist in interface Sessionobject - a transient instance to be made persistent
public void persist(String entityName,
Object object)
Sessioncascade="persist"
The semantics of this method are defined by JSR-220.
persist in interface SessionentityName - The entity nameobject - a transient instance to be made persistentpublic void delete(Object object)
Sessioncascade="delete"
delete in interface Sessionobject - the instance to be removed
public void delete(String entityName,
Object object)
Sessioncascade="delete"
delete in interface SessionentityName - The entity name for the instance to be removed.object - the instance to be removed
public void lock(Object object,
LockMode lockMode)
Session
lock in interface Sessionobject - a persistent or transient instancelockMode - the lock level
public void lock(String entityName,
Object object,
LockMode lockMode)
Session
lock in interface Sessionobject - a persistent or transient instancelockMode - the lock levelpublic Session.LockRequest buildLockRequest(LockOptions lockOptions)
Sessionsession.buildLockRequest().setLockMode(LockMode.PESSIMISTIC_WRITE).setTimeOut(60000).lock(entity);
buildLockRequest in interface SessionlockOptions - contains the lock level
public void refresh(Object object)
Session
refresh in interface Sessionobject - a persistent or detached instance
public void refresh(String entityName,
Object object)
Session
refresh in interface SessionentityName - a persistent classobject - a persistent or detached instance
public void refresh(Object object,
LockMode lockMode)
Session
refresh in interface Sessionobject - a persistent or detached instancelockMode - the lock mode to use
public void refresh(Object object,
LockOptions lockOptions)
Session
refresh in interface Sessionobject - a persistent or detached instancelockOptions - contains the lock mode to use
public void refresh(String entityName,
Object object,
LockOptions lockOptions)
Session
refresh in interface SessionentityName - a persistent classobject - a persistent or detached instancelockOptions - contains the lock mode to usepublic LockMode getCurrentLockMode(Object object)
Session
getCurrentLockMode in interface Sessionobject - a persistent instance
public Query createFilter(Object collection,
String queryString)
SessionQuery instance for the given collection and filter string. Contains an implicit FROM
element named this which refers to the defined table for the collection elements, as well as an implicit
WHERE restriction for this particular collection instance's key value.
createFilter in interface Sessioncollection - a persistent collectionqueryString - a Hibernate query fragment.
public void clear()
Session
clear in interface Session
public Object get(Class clazz,
Serializable id)
Session
get in interface Sessionclazz - a persistent classid - an identifier
public Object get(Class clazz,
Serializable id,
LockMode lockMode)
Session
get in interface Sessionclazz - a persistent classid - an identifierlockMode - the lock mode
public Object get(Class clazz,
Serializable id,
LockOptions lockOptions)
Session
get in interface Sessionclazz - a persistent classid - an identifierlockOptions - the lock mode
public Object get(String entityName,
Serializable id)
Session
get in interface SessionentityName - the entity nameid - an identifier
public Object get(String entityName,
Serializable id,
LockMode lockMode)
Session
get in interface SessionentityName - the entity nameid - an identifierlockMode - the lock mode
public Object get(String entityName,
Serializable id,
LockOptions lockOptions)
Session
get in interface SessionentityName - the entity nameid - an identifierlockOptions - contains the lock mode
public String getEntityName(Object object)
Session
getEntityName in interface Sessionobject - a persistent entity
public IdentifierLoadAccess byId(String entityName)
SessionIdentifierLoadAccess instance to retrieve the specified entity type by
primary key.
byId in interface SessionentityName - The entity name of the entity type to be retrieved
public IdentifierLoadAccess byId(Class entityClass)
SessionIdentifierLoadAccess instance to retrieve the specified entity by
primary key.
byId in interface SessionentityClass - The entity type to be retrieved
public NaturalIdLoadAccess byNaturalId(String entityName)
SessionNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
byNaturalId in interface SessionentityName - The entity name of the entity type to be retrieved
public NaturalIdLoadAccess byNaturalId(Class entityClass)
SessionNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
byNaturalId in interface SessionentityClass - The entity type to be retrieved
public SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
SessionSimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
bySimpleNaturalId in interface SessionentityName - The entity name of the entity type to be retrieved
public SimpleNaturalIdLoadAccess bySimpleNaturalId(Class entityClass)
SessionSimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its simple (single attribute) natural id.
bySimpleNaturalId in interface SessionentityClass - The entity type to be retrieved
public Filter enableFilter(String filterName)
Session
enableFilter in interface SessionfilterName - The name of the filter to be enabled.
public Filter getEnabledFilter(String filterName)
Session
getEnabledFilter in interface SessionfilterName - The name of the filter to be retrieved.
public void disableFilter(String filterName)
Session
disableFilter in interface SessionfilterName - The name of the filter to be disabled.public SessionStatistics getStatistics()
Session
getStatistics in interface Sessionpublic boolean isReadOnly(Object entityOrProxy)
Session
isReadOnly in interface SessionentityOrProxy - an entity or HibernateProxy
true if the entity or proxy is read-only, false if the entity or proxy is modifiable.Session.isDefaultReadOnly()
public void setReadOnly(Object entityOrProxy,
boolean readOnly)
Session
setReadOnly in interface SessionentityOrProxy - an entity or HibernateProxyreadOnly - true if the entity or proxy should be made read-only; false if the entity or
proxy should be made modifiableTo override this session's read-only/modifiable setting for entities
and proxies loaded by a Query:,
Query.setReadOnly(boolean)
public void doWork(Work work)
throws HibernateException
Session
doWork in interface Sessionwork - The work to be performed.
HibernateException - Generally indicates wrapped SQLException
public <T> T doReturningWork(ReturningWork<T> work)
throws HibernateException
SessionReturningWork.execute(java.sql.Connection) call.
doReturningWork in interface Sessionwork - The work to be performed.
ReturningWork.execute(java.sql.Connection).
HibernateException - Generally indicates wrapped SQLExceptionpublic Connection disconnect()
Session
disconnect in interface SessionnullSession.reconnect(Connection)public void reconnect(Connection connection)
Session
reconnect in interface Sessionconnection - a JDBC connectionSession.disconnect()
public boolean isFetchProfileEnabled(String name)
throws UnknownProfileException
Session
isFetchProfileEnabled in interface Sessionname - The name of the profile to be checked.
UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this feature
public void enableFetchProfile(String name)
throws UnknownProfileException
Session
enableFetchProfile in interface Sessionname - The name of the fetch profile to be enabled.
UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this feature
public void disableFetchProfile(String name)
throws UnknownProfileException
Session
disableFetchProfile in interface Sessionname - The name of the fetch profile to be disabled.
UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this featurepublic TypeHelper getTypeHelper()
SessionTypeHelper associated with this session's SessionFactory.
Equivalent to calling Session.getSessionFactory().getTypeHelper()
getTypeHelper in interface SessionTypeHelper associated with this session's SessionFactorypublic LobHelper getLobHelper()
Session
getLobHelper in interface Sessionpublic void addEventListeners(SessionEventListener... listeners)
Session
addEventListeners in interface Sessionlisteners - The listener(s) to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||