|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the internal contract between the Session and other parts of Hibernate such as implementors of Type or EntityPersister.
the interface to the application
,
the actual implementation
Method Summary | |
void |
afterScrollOperation()
|
void |
afterTransactionCompletion(boolean successful,
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 |
String |
bestGuessEntityName(Object object)
The best guess entity name for an entity not in an association |
Connection |
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()
|
Batcher |
getBatcher()
Get the prepared statement Batcher for this session |
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. |
EntityMode |
getEntityMode()
|
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()
|
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. |
JDBCContext |
getJDBCContext()
|
EventListeners |
getListeners()
Retrieves the configured event listeners from this event source. |
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 |
long |
getTimestamp()
System time before the start of the transaction |
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)
|
void |
setFlushMode(FlushMode fm)
|
Method Detail |
public Interceptor getInterceptor()
public void setAutoClear(boolean enabled)
public boolean isTransactionInProgress()
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
HibernateException
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
HibernateException
public Object immediateLoad(String entityName, Serializable id) throws HibernateException
HibernateException
public long getTimestamp()
public SessionFactoryImplementor getFactory()
public Batcher getBatcher()
public List list(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode)
public List list(CriteriaImpl criteria)
public List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
HibernateException
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
HibernateException
public EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
entityName
- optional entity nameobject
- the entity instance
HibernateException
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
HibernateException
public void afterTransactionCompletion(boolean successful, Transaction tx)
public void beforeTransactionCompletion(Transaction tx)
public Serializable getContextEntityIdentifier(Object object)
public String bestGuessEntityName(Object object)
public String guessEntityName(Object entity) throws HibernateException
HibernateException
public Object instantiate(String entityName, Serializable id) throws HibernateException
HibernateException
public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
HibernateException
public ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
HibernateException
public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
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
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)
filterParameterName
- The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.
public Type getFilterParameterType(String filterParameterName)
filterParameterName
- The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.public Map getEnabledFilters()
FilterImpl
instance.
public int getDontFlushFromFind()
public EventListeners getListeners()
public PersistenceContext getPersistenceContext()
public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public int executeNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters) throws HibernateException
HibernateException
public EntityMode getEntityMode()
public CacheMode getCacheMode()
public void setCacheMode(CacheMode cm)
public boolean isOpen()
public boolean isConnected()
public FlushMode getFlushMode()
public void setFlushMode(FlushMode fm)
public Connection connection()
public void flush()
public Query getNamedQuery(String name)
public Query getNamedSQLQuery(String name)
public boolean isEventSource()
public void afterScrollOperation()
public void setFetchProfile(String name)
public String getFetchProfile()
public JDBCContext getJDBCContext()
public boolean isClosed()
isOpen()
as this method does not attempt any JTA synch
registration, where as isOpen()
does; which makes this one
nicer to use for most internal purposes.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |