|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.hibernate.impl.SessionImpl
Concrete implementation of a Session, and also the central, organizing component of Hibernate's internal implementation. As such, this class exposes two interfaces; Session itself, to the application, and SessionImplementor, to other components of Hibernate. This class is not threadsafe.
| Method Summary | |
void |
afterOperation(boolean success)
Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processing |
void |
afterTransactionCompletion(boolean success,
Transaction tx)
Notify the session that the transaction completed, so we no longer own the old locks. |
void |
beforeTransactionCompletion(Transaction tx)
Notify the session that the transaction is about to complete |
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 |
void |
cancelQuery()
Cancel execution of the current query. |
void |
clear()
Completely clear the session. |
Connection |
close()
End the Session by disconnecting from the JDBC connection and cleaning up. |
Connection |
connection()
Get the JDBC connection. |
boolean |
contains(Object object)
Check if this instance is associated with this Session. |
Criteria |
createCriteria(Class persistentClass)
Create a new Criteria instance, for the given entity class, or a superclass of an entity class. |
Criteria |
createCriteria(Class persistentClass,
String alias)
Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias. |
Criteria |
createCriteria(String entityName)
Create a new Criteria instance, for the given entity name. |
Criteria |
createCriteria(String entityName,
String alias)
Create a new Criteria instance, for the given entity name, with the given alias. |
Query |
createFilter(Object collection,
String queryString)
Create a new instance of Query for the given collection and filter string. |
Query |
createQuery(String queryString)
Create a new instance of Query for the given query string. |
SQLQuery |
createSQLQuery(String sql)
Create a new instance of SQLQuery for the given SQL query string. |
Query |
createSQLQuery(String sql,
String[] returnAliases,
Class[] returnClasses)
Create a new instance of Query for the given SQL string. |
Query |
createSQLQuery(String sql,
String returnAlias,
Class returnClass)
Create a new instance of Query for the given SQL string. |
void |
delete(Object object)
Delete a persistent object |
int |
delete(String query)
Delete all objects returned by the query. |
int |
delete(String query,
Object[] values,
Type[] types)
Delete all objects returned by the query. |
void |
delete(String entityName,
Object object,
boolean isCascadeDeleteEnabled)
Delete a persistent object |
int |
delete(String query,
Object value,
Type type)
Delete all objects returned by the query. |
void |
disableFilter(String filterName)
Disable the named filter for the current session. |
Connection |
disconnect()
Disconnect the Session from the current JDBC connection. |
Filter |
enableFilter(String filterName)
Enable the named filter for this current session. |
void |
evict(Object object)
remove any hard references to the entity that are held by the infrastructure (references held by application or other persistant instances are okay) |
int |
executeUpdate(String query,
QueryParameters queryParameters)
Execute a HQL update or delete query |
Collection |
filter(Object collection,
String filter)
Apply a filter to a persistent collection. |
Collection |
filter(Object collection,
String filter,
Object[] values,
Type[] types)
Apply a filter to a persistent collection. |
Collection |
filter(Object collection,
String filter,
Object value,
Type type)
Apply a filter to a persistent collection. |
List |
find(String query)
Retrieve a list of persistent objects using a hibernate query |
List |
find(String query,
Object[] values,
Type[] types)
Execute a query with bind parameters. |
List |
find(String query,
Object value,
Type type)
Execute a query with bind parameters. |
void |
flush()
Force the Session to flush. |
void |
forceFlush(EntityEntry e)
Force an immediate flush |
Object |
get(Class entityClass,
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 entityClass,
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)
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. |
ActionQueue |
getActionQueue()
Get the ActionQueue for this session |
Batcher |
getBatcher()
Get the prepared statement Batcher for this session |
CacheMode |
getCacheMode()
Get the current cache mode. |
ConnectionReleaseMode |
getConnectionReleaseMode()
|
LockMode |
getCurrentLockMode(Object object)
Determine the current lock mode of the given object. |
int |
getDontFlushFromFind()
|
Filter |
getEnabledFilter(String filterName)
Retreive a currently enabled filter by name. |
Map |
getEnabledFilters()
Return the currently enabled filters. |
Serializable |
getEntityIdentifier(Object object)
Get the id value for an object that is actually associated with the session. |
EntityMode |
getEntityMode()
Retreive the entity mode in effect for this session. |
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 |
SessionFactoryImplementor |
getFactory()
Get the creating SessionFactoryImplementor |
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. |
Serializable |
getIdentifier(Object object)
Return the identifier of an entity instance cached by the Session, or throw an exception if the instance is transient or associated with a different Session. |
Interceptor |
getInterceptor()
Retrieves the interceptor currently in use by this event source. |
SessionEventListenerConfig |
getListeners()
Retrieves the configured event listeners from this event source. |
Query |
getNamedQuery(String queryName)
Obtain an instance of Query for a named query string defined in the mapping file. |
PersistenceContext |
getPersistenceContext()
Get the persistence context for this session |
Session |
getSession(EntityMode entityMode)
Starts a new Session with the given entity mode in effect. |
SessionFactory |
getSessionFactory()
Get the SessionFactory that created this instance. |
long |
getTimestamp()
System time before the start of the transaction |
String |
guessEntityName(Object object)
The guessed entity name for an entity not in an association |
Object |
immediateLoad(String entityName,
Serializable id)
Load the data for the object with the specified id into a newly created object. |
void |
initializeCollection(PersistentCollection collection,
boolean writing)
Initialize the collection (if not already initialized) |
Object |
instantiate(EntityPersister persister,
Serializable id)
give the interceptor an opportunity to override the default instantiation |
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 |
isAutoCloseSessionEnabled()
|
boolean |
isConnected()
Check if the Session is currently connected. |
boolean |
isDirty()
Does this Session contain any changes which must be synchronized with the database? Would any SQL be executed if we flushed this session? |
boolean |
isFlushBeforeCompletionEnabled()
|
boolean |
isFlushModeNever()
|
boolean |
isOpen()
Check if the Session is still open. |
boolean |
isTransactionInProgress()
Does this Session have an active Hibernate transaction or is there a JTA transaction in progress? |
Iterator |
iterate(String query)
Execute a query and return the results in an iterator. |
Iterator |
iterate(String query,
Object[] values,
Type[] types)
Execute a query and return the results in an iterator. |
Iterator |
iterate(String query,
Object value,
Type type)
Execute a query and return the results in an iterator. |
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)
|
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 entityClass,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
Object |
load(Class entityClass,
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. |
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. |
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. |
void |
managedClose()
|
void |
managedFlush()
|
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 |
merge(String entityName,
Object object,
Map copiedAlready)
Cascade merge an entity instance |
void |
persist(Object object)
Make a transient instance persistent. |
void |
persist(String entityName,
Object object)
Make a transient instance persistent. |
void |
persist(String entityName,
Object object,
Map copiedAlready)
Cascade persist an entity instance |
void |
reconnect()
Obtain a new JDBC connection. |
void |
reconnect(Connection conn)
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 |
replicate(Object obj,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value. |
void |
replicate(String entityName,
Object obj,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value. |
Serializable |
save(Object obj)
Persist the given transient instance, first assigning a generated identifier. |
void |
save(Object obj,
Serializable id)
Persist the given transient instance, using the given identifier. |
Serializable |
save(String entityName,
Object object)
Persist the given transient instance, first assigning a generated identifier. |
void |
save(String entityName,
Object object,
Serializable id)
Persist the given transient instance, using the given identifier. |
void |
saveOrUpdate(Object object)
Either save() or update() the given instance, depending upon the value of its identifier property. |
void |
saveOrUpdate(String entityName,
Object obj)
Either save() or update() the given instance, depending upon the value of its identifier property. |
Object |
saveOrUpdateCopy(Object object)
Copy the state of the given object onto the persistent object with the same identifier. |
Object |
saveOrUpdateCopy(Object object,
Serializable id)
Copy the state of the given object onto the persistent object with the given identifier. |
Object |
saveOrUpdateCopy(String entityName,
Object object)
Copy the state of the given object onto the persistent object with the same identifier. |
void |
saveOrUpdateCopy(String entityName,
Object object,
Map copiedAlready)
Cascade copy an entity instance |
Object |
saveOrUpdateCopy(String entityName,
Object object,
Serializable id)
Copy the state of the given object onto the persistent object with the given identifier. |
ScrollableResults |
scroll(CriteriaImpl criteria,
ScrollMode scrollMode)
|
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 cacheMode)
Set the cache mode. |
void |
setFlushMode(FlushMode flushMode)
Set the flush mode. |
boolean |
shouldAutoClose()
|
String |
toString()
|
void |
update(Object obj)
Update the persistent instance with the identifier of the given detached instance. |
void |
update(Object obj,
Serializable id)
Update the persistent state associated with the given identifier. |
void |
update(String entityName,
Object object)
Update the persistent instance with the identifier of the given detached instance. |
void |
update(String entityName,
Object object,
Serializable id)
Update the persistent state associated with the given identifier. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public Session getSession(EntityMode entityMode)
Session
getSession in interface SessionentityMode - The entity mode to use for the new session.
public void clear()
Session
clear in interface Sessionpublic Batcher getBatcher()
SessionImplementor
getBatcher in interface SessionImplementorpublic SessionFactoryImplementor getFactory()
SessionImplementor
getFactory in interface SessionImplementorpublic long getTimestamp()
SessionImplementor
getTimestamp in interface SessionImplementor
public Connection close()
throws HibernateException
Session
close in interface SessionHibernateExceptionpublic ConnectionReleaseMode getConnectionReleaseMode()
getConnectionReleaseMode in interface JDBCContext.Contextpublic boolean isAutoCloseSessionEnabled()
isAutoCloseSessionEnabled in interface JDBCContext.Contextpublic boolean isOpen()
Session
isOpen in interface Sessionpublic boolean isFlushModeNever()
isFlushModeNever in interface TransactionFactory.Contextpublic boolean isFlushBeforeCompletionEnabled()
isFlushBeforeCompletionEnabled in interface TransactionFactory.Contextpublic void managedFlush()
managedFlush in interface TransactionFactory.Contextpublic boolean shouldAutoClose()
shouldAutoClose in interface TransactionFactory.Contextpublic void managedClose()
managedClose in interface TransactionFactory.Context
public Connection connection()
throws HibernateException
Session
connection in interface SessionHibernateException - if the Session is disconnectedpublic boolean isConnected()
Session
isConnected in interface Sessionpublic boolean isTransactionInProgress()
SessionImplementor
isTransactionInProgress in interface SessionImplementor
public Connection disconnect()
throws HibernateException
Session
disconnect in interface SessionHibernateException - if the Session is disconnectedSession.reconnect()
public void reconnect()
throws HibernateException
Session
reconnect in interface SessionHibernateExceptionSession.disconnect()
public void reconnect(Connection conn)
throws HibernateException
Session
reconnect in interface Sessionconn - a JDBC connection
HibernateException - if the Session is connectedSession.disconnect()public void beforeTransactionCompletion(Transaction tx)
SessionImplementor
beforeTransactionCompletion in interface SessionImplementorpublic void setAutoClear(boolean enabled)
SessionImplementor
setAutoClear in interface SessionImplementorpublic void afterOperation(boolean success)
public void afterTransactionCompletion(boolean success,
Transaction tx)
SessionImplementor
afterTransactionCompletion in interface SessionImplementor
public LockMode getCurrentLockMode(Object object)
throws HibernateException
Session
getCurrentLockMode in interface Sessionobject - a persistent instance
HibernateException
public Object getEntityUsingInterceptor(EntityKey key)
throws HibernateException
SessionImplementor
getEntityUsingInterceptor in interface SessionImplementorHibernateException
public void saveOrUpdate(Object object)
throws HibernateException
Session
saveOrUpdate in interface Sessionobject - a transient or detached instance containing new or updated state
HibernateExceptionSession.save(java.lang.Object),
Session.update(Object object, Serializable id)
public void saveOrUpdate(String entityName,
Object obj)
throws HibernateException
Session
saveOrUpdate in interface Sessionobj - a transient or detached instance containing new or updated state
HibernateExceptionSession.save(java.lang.Object),
Session.update(Object object, Serializable id)
public void save(Object obj,
Serializable id)
throws HibernateException
Session
save in interface Sessionobj - a transient instance of a persistent classid - an unused valid identifier
HibernateException
public Serializable save(Object obj)
throws HibernateException
Session
save in interface Sessionobj - a transient instance of a persistent class
HibernateException
public Serializable save(String entityName,
Object object)
throws HibernateException
Session
save in interface Sessionobject - a transient instance of a persistent class
HibernateException
public void save(String entityName,
Object object,
Serializable id)
throws HibernateException
Session
save in interface Sessionobject - a transient instance of a persistent classid - an unused valid identifier
HibernateException
public void update(Object obj)
throws HibernateException
Session
update in interface Sessionobj - a detached instance containing updated state
HibernateException
public void update(Object obj,
Serializable id)
throws HibernateException
Session
update in interface Sessionobj - a detached instance containing updated stateid - identifier of persistent instance
HibernateException
public void update(String entityName,
Object object)
throws HibernateException
Session
update in interface Sessionobject - a detached instance containing updated state
HibernateException
public void update(String entityName,
Object object,
Serializable id)
throws HibernateException
Session
update in interface Sessionobject - a detached instance containing updated stateid - identifier of persistent instance
HibernateException
public void lock(Object object,
LockMode lockMode)
throws HibernateException
Session
lock in interface Sessionobject - a persistent or transient instancelockMode - the lock level
HibernateException
public void lock(String entityName,
Object object,
LockMode lockMode)
throws HibernateException
Session
lock in interface Sessionobject - a persistent or transient instancelockMode - the lock level
HibernateException
public void persist(String entityName,
Object object,
Map copiedAlready)
throws HibernateException
SessionImplementor
persist in interface SessionImplementorHibernateException
public void persist(String entityName,
Object object)
throws HibernateException
Session
persist in interface Sessionobject - a transient instance to be made persistent
HibernateException
public void persist(Object object)
throws HibernateException
Session
persist in interface Sessionobject - a transient instance to be made persistent
HibernateException
public Object merge(String entityName,
Object object)
throws HibernateException
Session
merge in interface Sessionobject - a detached instance with state to be copied
HibernateException
public Object merge(Object object)
throws HibernateException
Session
merge in interface Sessionobject - a detached instance with state to be copied
HibernateException
public void merge(String entityName,
Object object,
Map copiedAlready)
throws HibernateException
SessionImplementor
merge in interface SessionImplementorHibernateException
public Object saveOrUpdateCopy(String entityName,
Object object)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a transient instance with state to be copied
HibernateException
public Object saveOrUpdateCopy(Object object)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a transient instance with state to be copied
HibernateException
public Object saveOrUpdateCopy(String entityName,
Object object,
Serializable id)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a persistent or transient instance with state to be copiedid - the identifier of the instance to copy to
HibernateException
public Object saveOrUpdateCopy(Object object,
Serializable id)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a persistent or transient instance with state to be copiedid - the identifier of the instance to copy to
HibernateException
public void saveOrUpdateCopy(String entityName,
Object object,
Map copiedAlready)
throws HibernateException
SessionImplementor
saveOrUpdateCopy in interface SessionImplementorHibernateException
public void delete(Object object)
throws HibernateException
delete in interface Sessionobject - the instance to be removed
HibernateException
public void delete(String entityName,
Object object,
boolean isCascadeDeleteEnabled)
throws HibernateException
delete in interface SessionImplementorHibernateException
public void load(Object object,
Serializable id)
throws HibernateException
Session
load in interface Sessionobject - an "empty" instance of the persistent classid - a valid identifier of an existing persistent instance of the class
HibernateException
public Object load(Class entityClass,
Serializable id)
throws HibernateException
Session
load in interface SessionentityClass - a persistent classid - a valid identifier of an existing persistent instance of the class
HibernateException
public Object load(String entityName,
Serializable id)
throws HibernateException
Session
load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the class
HibernateException
public Object get(Class entityClass,
Serializable id)
throws HibernateException
Session
get in interface SessionentityClass - a persistent classid - an identifier
HibernateException
public Object get(String entityName,
Serializable id)
throws HibernateException
Session
get in interface SessionentityName - the entity nameid - an identifier
HibernateException
public Object immediateLoad(String entityName,
Serializable id)
throws HibernateException
immediateLoad in interface SessionImplementorHibernateException
public Object internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable)
throws HibernateException
SessionImplementor
internalLoad in interface SessionImplementorHibernateException
public Object load(Class entityClass,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
load in interface SessionentityClass - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock level
HibernateException
public Object load(String entityName,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock level
HibernateException
public Object get(Class entityClass,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
get in interface SessionentityClass - a persistent classid - an identifierlockMode - the lock mode
HibernateException
public Object get(String entityName,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
get in interface SessionentityName - the entity nameid - an identifierlockMode - the lock mode
HibernateException
public void refresh(Object object)
throws HibernateException
Session
refresh in interface Sessionobject - a persistent or detached instance
HibernateException
public void refresh(Object object,
LockMode lockMode)
throws HibernateException
Session
refresh in interface Sessionobject - a persistent or detached instancelockMode - the lock mode to use
HibernateException
public void replicate(Object obj,
ReplicationMode replicationMode)
throws HibernateException
Session
replicate in interface Sessionobj - a detached instance of a persistent class
HibernateException
public void replicate(String entityName,
Object obj,
ReplicationMode replicationMode)
throws HibernateException
Session
replicate in interface Sessionobj - a detached instance of a persistent class
HibernateException
public void evict(Object object)
throws HibernateException
evict in interface Sessionobject - a persistent instance
HibernateException
public boolean isDirty()
throws HibernateException
Session
isDirty in interface SessionHibernateException
public void flush()
throws HibernateException
Session
flush in interface SessionHibernateException
public void forceFlush(EntityEntry e)
throws HibernateException
SessionImplementor
forceFlush in interface SessionImplementorHibernateExceptionpublic 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 retreived.
public void disableFilter(String filterName)
Session
disableFilter in interface SessionfilterName - The name of the filter to be disabled.public 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 SessionImplementor
public List find(String query)
throws HibernateException
find in interface Sessionquery - a query expressed in Hibernate's query language
HibernateException
public List find(String query,
Object value,
Type type)
throws HibernateException
Session
find in interface Sessionquery - the query stringvalue - a value to be bound to a "?" placeholder (JDBC IN parameter).type - the Hibernate type of the value
HibernateExceptionfor access to Type instances
public List find(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
find in interface Sessionquery - the query stringvalues - an array of values to be bound to the "?" placeholders (JDBC IN parameters).types - an array of Hibernate types of the values
HibernateExceptionfor access to Type instances
public List list(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
list in interface SessionImplementorHibernateException
public int executeUpdate(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
executeUpdate in interface SessionImplementorHibernateException
public Iterator iterate(String query)
throws HibernateException
Session
iterate in interface Sessionquery - the query string
HibernateException
public Iterator iterate(String query,
Object value,
Type type)
throws HibernateException
Session
iterate in interface Sessionquery - the query stringvalue - a value to be witten to a "?" placeholder in the query stringtype - the hibernate type of value
HibernateException
public Iterator iterate(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
iterate in interface Sessionquery - the query stringvalues - a list of values to be written to "?" placeholders in the querytypes - a list of Hibernate types of the values
HibernateException
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 int delete(String query)
throws HibernateException
Session
delete in interface Sessionquery - the query string
HibernateException
public int delete(String query,
Object value,
Type type)
throws HibernateException
Session
delete in interface Sessionquery - the query stringvalue - a value to be witten to a "?" placeholder in the query string.type - the hibernate type of value.
HibernateException
public int delete(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
delete in interface Sessionquery - the query stringvalues - a list of values to be written to "?" placeholders in the query.types - a list of Hibernate types of the values
HibernateException
public Query createFilter(Object collection,
String queryString)
Session
createFilter in interface Sessioncollection - a persistent collectionqueryString - a Hibernate query
public Query createQuery(String queryString)
Session
createQuery in interface SessionqueryString - a HQL query
public Query getNamedQuery(String queryName)
throws MappingException
Session
getNamedQuery in interface SessionqueryName - the name of a query defined externally
MappingException
public Object instantiate(String entityName,
Serializable id)
throws HibernateException
SessionImplementor
instantiate in interface SessionImplementorHibernateException
public Object instantiate(EntityPersister persister,
Serializable id)
throws HibernateException
instantiate in interface SessionImplementorHibernateExceptionpublic EntityMode getEntityMode()
Session
getEntityMode in interface Sessionpublic void setFlushMode(FlushMode flushMode)
Session
setFlushMode in interface SessionflushMode - the FlushModeFlushModepublic FlushMode getFlushMode()
Session
getFlushMode in interface Sessionpublic CacheMode getCacheMode()
Session
getCacheMode in interface Sessionpublic void setCacheMode(CacheMode cacheMode)
Session
setCacheMode in interface Session
public Transaction beginTransaction()
throws HibernateException
Session
beginTransaction in interface SessionHibernateExceptionTransaction
public EntityPersister getEntityPersister(String entityName,
Object object)
SessionImplementor
getEntityPersister in interface SessionImplementorentityName - optional entity nameobject - the entity instance
public Serializable getIdentifier(Object object)
throws HibernateException
Session
getIdentifier in interface Sessionobject - a persistent instance
HibernateException - if the Session is connectedpublic Serializable getEntityIdentifier(Object object)
getEntityIdentifier in interface SessionImplementor
public Collection filter(Object collection,
String filter)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query string
HibernateException
public Collection filter(Object collection,
String filter,
Object value,
Type type)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query stringvalue - a value to be witten to a "?" placeholder in the query stringtype - the hibernate type of value
HibernateException
public Collection filter(Object collection,
String filter,
Object[] values,
Type[] types)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query stringvalues - a list of values to be written to "?" placeholders in the querytypes - a list of Hibernate types of the values
HibernateException
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 Criteria createCriteria(Class persistentClass,
String alias)
Session
createCriteria in interface SessionpersistentClass - a class, which is persistent, or has persistent subclasses
public Criteria createCriteria(String entityName,
String alias)
Session
createCriteria in interface SessionentityName -
public Criteria createCriteria(Class persistentClass)
Session
createCriteria in interface SessionpersistentClass - a class, which is persistent, or has persistent subclasses
public Criteria createCriteria(String entityName)
Session
createCriteria in interface SessionentityName -
public ScrollableResults scroll(CriteriaImpl criteria,
ScrollMode scrollMode)
public List list(CriteriaImpl criteria)
throws HibernateException
HibernateExceptionpublic boolean contains(Object object)
Session
contains in interface Sessionobject - an instance of a persistent class
public SQLQuery createSQLQuery(String sql)
Session
createSQLQuery in interface Sessionsql - a SQL query
public Query createSQLQuery(String sql,
String returnAlias,
Class returnClass)
Session
createSQLQuery in interface Sessionsql - a query expressed in SQLreturnAlias - a table alias that appears inside {} in the SQL stringreturnClass - the returned persistent class
public Query createSQLQuery(String sql,
String[] returnAliases,
Class[] returnClasses)
Session
createSQLQuery in interface Sessionsql - a query expressed in SQLreturnAliases - an array of table aliases that appear inside {} in the SQL stringreturnClasses - the returned persistent classes
public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scrollCustomQuery in interface SessionImplementorHibernateException
public List listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
listCustomQuery in interface SessionImplementorHibernateExceptionpublic SessionFactory getSessionFactory()
Session
getSessionFactory in interface SessionSessionFactory
public void initializeCollection(PersistentCollection collection,
boolean writing)
throws HibernateException
SessionImplementor
initializeCollection in interface SessionImplementorHibernateExceptionpublic String bestGuessEntityName(Object object)
SessionImplementor
bestGuessEntityName in interface SessionImplementorpublic String getEntityName(Object object)
Session
getEntityName in interface Sessionobject - a persistent entity
public String guessEntityName(Object object)
throws HibernateException
SessionImplementor
guessEntityName in interface SessionImplementorHibernateException
public void cancelQuery()
throws HibernateException
Session
cancelQuery in interface SessionHibernateExceptionpublic Interceptor getInterceptor()
SessionImplementor
getInterceptor in interface SessionImplementorpublic int getDontFlushFromFind()
getDontFlushFromFind in interface SessionImplementorpublic String toString()
public SessionEventListenerConfig getListeners()
SessionImplementor
getListeners in interface SessionImplementorpublic ActionQueue getActionQueue()
SessionImplementor
getActionQueue in interface SessionImplementorpublic PersistenceContext getPersistenceContext()
SessionImplementor
getPersistenceContext in interface SessionImplementor
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||