org.hibernate.internal
Class StatelessSessionImpl

java.lang.Object
  extended by org.hibernate.internal.AbstractSessionImpl
      extended by org.hibernate.internal.StatelessSessionImpl
All Implemented Interfaces:
Serializable, LobCreationContext, SessionImplementor, TransactionContext, SharedSessionContract, StatelessSession

public class StatelessSessionImpl
extends AbstractSessionImpl
implements StatelessSession

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
 
Field Summary
 
Fields inherited from class org.hibernate.internal.AbstractSessionImpl
factory
 
Method Summary
 void afterOperation(boolean success)
           
 void afterScrollOperation()
           
 void afterTransactionBegin(TransactionImplementor hibernateTransaction)
           
 void afterTransactionCompletion(TransactionImplementor hibernateTransaction, boolean successful)
           
 void applyNonFlushedChanges(NonFlushedChanges nonFlushedChanges)
          Apply non-flushed changes from a different session to this session.
 void beforeTransactionCompletion(TransactionImplementor hibernateTransaction)
           
 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 close()
          Close the stateless session and release the JDBC connection.
 Connection connection()
          Returns the current JDBC connection associated with this instance.

If the session is using aggressive connection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call.
 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.
 void delete(Object entity)
          Delete a row.
 void delete(String entityName, Object entity)
          Delete a row.
 void disableTransactionAutoJoin()
          Disable automatic transaction joining.
 int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, 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()
           
 Object get(Class entityClass, Serializable id)
          Retrieve a row.
 Object get(Class entityClass, Serializable id, LockMode lockMode)
          Retrieve a row, obtaining the specified lock mode.
 Object get(String entityName, Serializable id)
          Retrieve a row.
 Object get(String entityName, Serializable id, LockMode lockMode)
          Retrieve a row, obtaining the specified lock mode.
 CacheMode getCacheMode()
           
 ConnectionReleaseMode getConnectionReleaseMode()
          Get the mode for releasing JDBC connection in effect for ths context.
 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
 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.
 LoadQueryInfluencers getLoadQueryInfluencers()
          Get the load query influencers associated with this session.
 NonFlushedChanges getNonFlushedChanges()
          Return changes to this session that have not been flushed yet.
 PersistenceContext getPersistenceContext()
          Get the persistence context for this session
 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.
 TransactionEnvironment getTransactionEnvironment()
          Obtain the TransactionEnvironment associated with this context.
 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)
 Serializable insert(Object entity)
          Insert a row.
 Serializable insert(String entityName, Object entity)
          Insert a row.
 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()
          Should session automatically be closed after transaction completion in this context?
 boolean isConnected()
           
 boolean isDefaultReadOnly()
           
 boolean isEventSource()
           
 boolean isFlushBeforeCompletionEnabled()
          Should before transaction completion processing perform a flush when initiated from JTA synchronization for this context?
 boolean isFlushModeNever()
          Should flushes only happen manually for this context?
 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(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
 void managedClose()
          Perform a managed close.
 void managedFlush()
          Perform a managed flush.
 String onPrepareStatement(String sql)
           
 void refresh(Object entity)
          Refresh the entity instance state from the database.
 void refresh(Object entity, LockMode lockMode)
          Refresh the entity instance state from the database.
 void refresh(String entityName, Object entity)
          Refresh the entity instance state from the database.
 void refresh(String entityName, Object entity, LockMode lockMode)
          Refresh the entity instance state from the database.
 ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode)
          Execute a criteria query
 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 setDefaultReadOnly(boolean readOnly)
           
 void setFetchProfile(String name)
          Set the current internal fetch profile for this session.
 void setFlushMode(FlushMode fm)
           
 boolean shouldAutoClose()
          Should JTA synchronization processing perform a automatic close (call to TransactionContext.managedClose() for this context?
 boolean shouldAutoJoinTransaction()
          Should transactions be auto joined? Generally this is only a concern for CMT transactions.
 void update(Object entity)
          Update a row.
 void update(String entityName, Object entity)
          Update a row.
 
Methods inherited from class org.hibernate.internal.AbstractSessionImpl
createQuery, createSQLQuery, errorIfClosed, execute, generateCacheKey, generateEntityKey, getFactory, getHQLQueryPlan, getJdbcConnectionAccess, getNamedQuery, getNamedSQLQuery, getNativeSQLQueryPlan, getTenantIdentifier, isClosed, list, scroll, setClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.SharedSessionContract
createQuery, createSQLQuery, getNamedQuery, getTenantIdentifier
 

Method Detail

getTransactionCoordinator

public TransactionCoordinator getTransactionCoordinator()
Description copied from interface: SessionImplementor
Retrieve access to the session's transaction coordinator.

Specified by:
getTransactionCoordinator in interface SessionImplementor
Returns:
The transaction coordinator.

getTransactionEnvironment

public TransactionEnvironment getTransactionEnvironment()
Description copied from interface: TransactionContext
Obtain the TransactionEnvironment associated with this context.

Specified by:
getTransactionEnvironment in interface TransactionContext
Overrides:
getTransactionEnvironment in class AbstractSessionImpl
Returns:
The transaction environment.

insert

public Serializable insert(Object entity)
Description copied from interface: StatelessSession
Insert a row.

Specified by:
insert in interface StatelessSession
Parameters:
entity - a new transient instance

insert

public Serializable insert(String entityName,
                           Object entity)
Description copied from interface: StatelessSession
Insert a row.

Specified by:
insert in interface StatelessSession
Parameters:
entityName - The entityName for the entity to be inserted
entity - a new transient instance
Returns:
the identifier of the instance

delete

public void delete(Object entity)
Description copied from interface: StatelessSession
Delete a row.

Specified by:
delete in interface StatelessSession
Parameters:
entity - a detached entity instance

delete

public void delete(String entityName,
                   Object entity)
Description copied from interface: StatelessSession
Delete a row.

Specified by:
delete in interface StatelessSession
Parameters:
entityName - The entityName for the entity to be deleted
entity - a detached entity instance

update

public void update(Object entity)
Description copied from interface: StatelessSession
Update a row.

Specified by:
update in interface StatelessSession
Parameters:
entity - a detached entity instance

update

public void update(String entityName,
                   Object entity)
Description copied from interface: StatelessSession
Update a row.

Specified by:
update in interface StatelessSession
Parameters:
entityName - The entityName for the entity to be updated
entity - a detached entity instance

get

public Object get(Class entityClass,
                  Serializable id)
Description copied from interface: StatelessSession
Retrieve a row.

Specified by:
get in interface StatelessSession
Returns:
a detached entity instance

get

public Object get(Class entityClass,
                  Serializable id,
                  LockMode lockMode)
Description copied from interface: StatelessSession
Retrieve a row, obtaining the specified lock mode.

Specified by:
get in interface StatelessSession
Returns:
a detached entity instance

get

public Object get(String entityName,
                  Serializable id)
Description copied from interface: StatelessSession
Retrieve a row.

Specified by:
get in interface StatelessSession
Returns:
a detached entity instance

get

public Object get(String entityName,
                  Serializable id,
                  LockMode lockMode)
Description copied from interface: StatelessSession
Retrieve a row, obtaining the specified lock mode.

Specified by:
get in interface StatelessSession
Returns:
a detached entity instance

refresh

public void refresh(Object entity)
Description copied from interface: StatelessSession
Refresh the entity instance state from the database.

Specified by:
refresh in interface StatelessSession
Parameters:
entity - The entity to be refreshed.

refresh

public void refresh(String entityName,
                    Object entity)
Description copied from interface: StatelessSession
Refresh the entity instance state from the database.

Specified by:
refresh in interface StatelessSession
Parameters:
entityName - The entityName for the entity to be refreshed.
entity - The entity to be refreshed.

refresh

public void refresh(Object entity,
                    LockMode lockMode)
Description copied from interface: StatelessSession
Refresh the entity instance state from the database.

Specified by:
refresh in interface StatelessSession
Parameters:
entity - The entity to be refreshed.
lockMode - The LockMode to be applied.

refresh

public void refresh(String entityName,
                    Object entity,
                    LockMode lockMode)
Description copied from interface: StatelessSession
Refresh the entity instance state from the database.

Specified by:
refresh in interface StatelessSession
Parameters:
entityName - The entityName for the entity to be refreshed.
entity - The entity to be refreshed.
lockMode - The LockMode to be applied.

immediateLoad

public Object immediateLoad(String entityName,
                            Serializable id)
                     throws HibernateException
Description copied from interface: SessionImplementor
Load an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.

Specified by:
immediateLoad in interface SessionImplementor
Throws:
HibernateException

initializeCollection

public void initializeCollection(PersistentCollection collection,
                                 boolean writing)
                          throws HibernateException
Description copied from interface: SessionImplementor
Initialize the collection (if not already initialized)

Specified by:
initializeCollection in interface SessionImplementor
Throws:
HibernateException

instantiate

public Object instantiate(String entityName,
                          Serializable id)
                   throws HibernateException
Description copied from interface: SessionImplementor
Instantiate the entity class, initializing with the given identifier

Specified by:
instantiate in interface SessionImplementor
Throws:
HibernateException

internalLoad

public Object internalLoad(String entityName,
                           Serializable id,
                           boolean eager,
                           boolean nullable)
                    throws HibernateException
Description copied from interface: SessionImplementor
Load an instance without checking if it was deleted. When nullable is disabled this method may create a new proxy or return an existing proxy; if it does not exist, throw an exception. When nullable is enabled, the method does not create new proxies (but might return an existing proxy); if it does not exist, return null. When eager is enabled, the object is eagerly fetched

Specified by:
internalLoad in interface SessionImplementor
Throws:
HibernateException

iterate

public Iterator iterate(String query,
                        QueryParameters queryParameters)
                 throws HibernateException
Description copied from interface: SessionImplementor
Execute an iterate() query

Specified by:
iterate in interface SessionImplementor
Throws:
HibernateException

iterateFilter

public Iterator iterateFilter(Object collection,
                              String filter,
                              QueryParameters queryParameters)
                       throws HibernateException
Description copied from interface: SessionImplementor
Iterate a filter

Specified by:
iterateFilter in interface SessionImplementor
Throws:
HibernateException

listFilter

public List listFilter(Object collection,
                       String filter,
                       QueryParameters queryParameters)
                throws HibernateException
Description copied from interface: SessionImplementor
Execute a filter

Specified by:
listFilter in interface SessionImplementor
Throws:
HibernateException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface SessionImplementor

close

public void close()
Description copied from interface: StatelessSession
Close the stateless session and release the JDBC connection.

Specified by:
close in interface StatelessSession

getConnectionReleaseMode

public ConnectionReleaseMode getConnectionReleaseMode()
Description copied from interface: TransactionContext
Get the mode for releasing JDBC connection in effect for ths context.

Specified by:
getConnectionReleaseMode in interface TransactionContext
Returns:
The connection release mode.

shouldAutoJoinTransaction

public boolean shouldAutoJoinTransaction()
Description copied from interface: TransactionContext
Should transactions be auto joined? Generally this is only a concern for CMT transactions. The default should be to auto join. JPA defines an explicit operation for joining a CMT transaction.

Specified by:
shouldAutoJoinTransaction in interface TransactionContext
Returns:
Should we automatically join transactions

isAutoCloseSessionEnabled

public boolean isAutoCloseSessionEnabled()
Description copied from interface: TransactionContext
Should session automatically be closed after transaction completion in this context?

Specified by:
isAutoCloseSessionEnabled in interface TransactionContext
Returns:
true/false appropriately.

isFlushBeforeCompletionEnabled

public boolean isFlushBeforeCompletionEnabled()
Description copied from interface: TransactionContext
Should before transaction completion processing perform a flush when initiated from JTA synchronization for this context?

Specified by:
isFlushBeforeCompletionEnabled in interface TransactionContext
Returns:
true/false appropriately.

isFlushModeNever

public boolean isFlushModeNever()
Description copied from interface: TransactionContext
Should flushes only happen manually for this context?

Specified by:
isFlushModeNever in interface TransactionContext
Returns:
true/false appropriately.

managedClose

public void managedClose()
Description copied from interface: TransactionContext
Perform a managed close.

Specified by:
managedClose in interface TransactionContext

managedFlush

public void managedFlush()
Description copied from interface: TransactionContext
Perform a managed flush.

Specified by:
managedFlush in interface TransactionContext

shouldAutoClose

public boolean shouldAutoClose()
Description copied from interface: TransactionContext
Should JTA synchronization processing perform a automatic close (call to TransactionContext.managedClose() for this context?

Specified by:
shouldAutoClose in interface TransactionContext
Returns:
true/false appropriately.

afterTransactionBegin

public void afterTransactionBegin(TransactionImplementor hibernateTransaction)
Specified by:
afterTransactionBegin in interface TransactionContext

beforeTransactionCompletion

public void beforeTransactionCompletion(TransactionImplementor hibernateTransaction)
Specified by:
beforeTransactionCompletion in interface TransactionContext

afterTransactionCompletion

public void afterTransactionCompletion(TransactionImplementor hibernateTransaction,
                                       boolean successful)
Specified by:
afterTransactionCompletion in interface TransactionContext

onPrepareStatement

public String onPrepareStatement(String sql)
Specified by:
onPrepareStatement in interface TransactionContext

bestGuessEntityName

public String bestGuessEntityName(Object object)
Description copied from interface: SessionImplementor
The best guess entity name for an entity not in an association

Specified by:
bestGuessEntityName in interface SessionImplementor

connection

public Connection connection()
Description copied from interface: StatelessSession
Returns the current JDBC connection associated with this instance.

If the session is using aggressive connection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call. Otherwise, the application should not close the connection.

Specified by:
connection in interface SessionImplementor
Specified by:
connection in interface StatelessSession

executeUpdate

public int executeUpdate(String query,
                         QueryParameters queryParameters)
                  throws HibernateException
Description copied from interface: SessionImplementor
Execute a HQL update or delete query

Specified by:
executeUpdate in interface SessionImplementor
Throws:
HibernateException

getCacheMode

public CacheMode getCacheMode()
Specified by:
getCacheMode in interface SessionImplementor

getDontFlushFromFind

public int getDontFlushFromFind()
Specified by:
getDontFlushFromFind in interface SessionImplementor

getEnabledFilters

public Map getEnabledFilters()
Description copied from interface: SessionImplementor
Return the currently enabled filters. The filter map is keyed by filter name, with values corresponding to the FilterImpl instance.

Specified by:
getEnabledFilters in interface SessionImplementor
Returns:
The currently enabled filters.

getContextEntityIdentifier

public Serializable getContextEntityIdentifier(Object object)
Description copied from interface: SessionImplementor
Return the identifier of the persistent object, or null if not associated with the session

Specified by:
getContextEntityIdentifier in interface SessionImplementor

getEntityMode

public EntityMode getEntityMode()

getEntityPersister

public EntityPersister getEntityPersister(String entityName,
                                          Object object)
                                   throws HibernateException
Description copied from interface: SessionImplementor
Get the EntityPersister for any instance

Specified by:
getEntityPersister in interface SessionImplementor
Parameters:
entityName - optional entity name
object - the entity instance
Throws:
HibernateException

getEntityUsingInterceptor

public Object getEntityUsingInterceptor(EntityKey key)
                                 throws HibernateException
Description copied from interface: SessionImplementor
Get the entity instance associated with the given Key, calling the Interceptor if necessary

Specified by:
getEntityUsingInterceptor in interface SessionImplementor
Throws:
HibernateException

getFilterParameterType

public Type getFilterParameterType(String filterParameterName)
Description copied from interface: SessionImplementor
Retreive the type for a given filter parrameter.

Specified by:
getFilterParameterType in interface SessionImplementor
Parameters:
filterParameterName - The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.
Returns:
The filter param type

getFilterParameterValue

public Object getFilterParameterValue(String filterParameterName)
Description copied from interface: SessionImplementor
Retreive the currently set value for a filter parameter.

Specified by:
getFilterParameterValue in interface SessionImplementor
Parameters:
filterParameterName - The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.
Returns:
The filter parameter value.

getFlushMode

public FlushMode getFlushMode()
Specified by:
getFlushMode in interface SessionImplementor

getInterceptor

public Interceptor getInterceptor()
Description copied from interface: SessionImplementor
Retrieves the interceptor currently in use by this event source.

Specified by:
getInterceptor in interface SessionImplementor
Returns:
The interceptor.

getPersistenceContext

public PersistenceContext getPersistenceContext()
Description copied from interface: SessionImplementor
Get the persistence context for this session

Specified by:
getPersistenceContext in interface SessionImplementor

getTimestamp

public long getTimestamp()
Description copied from interface: SessionImplementor
System time before the start of the transaction

Specified by:
getTimestamp in interface SessionImplementor

guessEntityName

public String guessEntityName(Object entity)
                       throws HibernateException
Description copied from interface: SessionImplementor
The guessed entity name for an entity not in an association

Specified by:
guessEntityName in interface SessionImplementor
Throws:
HibernateException

isConnected

public boolean isConnected()
Specified by:
isConnected in interface SessionImplementor

isTransactionInProgress

public boolean isTransactionInProgress()
Description copied from interface: SessionImplementor
Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?

Specified by:
isTransactionInProgress in interface SessionImplementor

setAutoClear

public void setAutoClear(boolean enabled)
Description copied from interface: SessionImplementor
Enable/disable automatic cache clearing from after transaction completion (for EJB3)

Specified by:
setAutoClear in interface SessionImplementor

disableTransactionAutoJoin

public void disableTransactionAutoJoin()
Description copied from interface: SessionImplementor
Disable automatic transaction joining. The really only has any effect for CMT transactions. The default Hibernate behavior is to auto join any active JTA transaction (register Synchronization). JPA however defines an explicit join transaction operation. See javax.persistence.EntityManager#joinTransaction

Specified by:
disableTransactionAutoJoin in interface SessionImplementor

setCacheMode

public void setCacheMode(CacheMode cm)
Specified by:
setCacheMode in interface SessionImplementor

setFlushMode

public void setFlushMode(FlushMode fm)
Specified by:
setFlushMode in interface SessionImplementor

getTransaction

public Transaction getTransaction()
                           throws HibernateException
Description copied from interface: SharedSessionContract
Get the Transaction instance associated with this session. The concrete type of the returned Transaction object is determined by the hibernate.transaction_factory property.

Specified by:
getTransaction in interface SharedSessionContract
Returns:
a Transaction instance
Throws:
HibernateException

beginTransaction

public Transaction beginTransaction()
                             throws HibernateException
Description copied from interface: SharedSessionContract
Begin a unit of work and return the associated Transaction object. If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the context of the existing underlying transaction.

Specified by:
beginTransaction in interface SharedSessionContract
Returns:
a Transaction instance
Throws:
HibernateException
See Also:
SharedSessionContract.getTransaction()

isEventSource

public boolean isEventSource()
Specified by:
isEventSource in interface SessionImplementor

isDefaultReadOnly

public boolean isDefaultReadOnly()

setDefaultReadOnly

public void setDefaultReadOnly(boolean readOnly)
                        throws HibernateException
Throws:
HibernateException

list

public List list(String query,
                 QueryParameters queryParameters)
          throws HibernateException
Description copied from interface: SessionImplementor
Execute a find() query

Specified by:
list in interface SessionImplementor
Throws:
HibernateException

afterOperation

public void afterOperation(boolean success)

createCriteria

public Criteria createCriteria(Class persistentClass,
                               String alias)
Description copied from interface: SharedSessionContract
Create Criteria instance for the given class (entity or subclasses/implementors), using a specific alias.

Specified by:
createCriteria in interface SharedSessionContract
Parameters:
persistentClass - The class, which is an entity, or has entity subclasses/implementors
alias - The alias to use
Returns:
The criteria instance for manipulation and execution

createCriteria

public Criteria createCriteria(String entityName,
                               String alias)
Description copied from interface: SharedSessionContract
Create Criteria instance for the given entity name, using a specific alias.

Specified by:
createCriteria in interface SharedSessionContract
Parameters:
entityName - The entity name
alias - The alias to use
Returns:
The criteria instance for manipulation and execution

createCriteria

public Criteria createCriteria(Class persistentClass)
Description copied from interface: SharedSessionContract
Create Criteria instance for the given class (entity or subclasses/implementors)

Specified by:
createCriteria in interface SharedSessionContract
Parameters:
persistentClass - The class, which is an entity, or has entity subclasses/implementors
Returns:
The criteria instance for manipulation and execution

createCriteria

public Criteria createCriteria(String entityName)
Description copied from interface: SharedSessionContract
Create Criteria instance for the given entity name.

Specified by:
createCriteria in interface SharedSessionContract
Parameters:
entityName - The entity name
Returns:
The criteria instance for manipulation and execution

scroll

public ScrollableResults scroll(CriteriaImpl criteria,
                                ScrollMode scrollMode)
Description copied from interface: SessionImplementor
Execute a criteria query

Specified by:
scroll in interface SessionImplementor

list

public List list(CriteriaImpl criteria)
          throws HibernateException
Description copied from interface: SessionImplementor
Execute a criteria query

Specified by:
list in interface SessionImplementor
Throws:
HibernateException

listCustomQuery

public List listCustomQuery(CustomQuery customQuery,
                            QueryParameters queryParameters)
                     throws HibernateException
Description copied from interface: SessionImplementor
Execute an SQL Query

Specified by:
listCustomQuery in interface SessionImplementor
Throws:
HibernateException

scrollCustomQuery

public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
                                           QueryParameters queryParameters)
                                    throws HibernateException
Description copied from interface: SessionImplementor
Execute an SQL Query

Specified by:
scrollCustomQuery in interface SessionImplementor
Throws:
HibernateException

scroll

public ScrollableResults scroll(String query,
                                QueryParameters queryParameters)
                         throws HibernateException
Description copied from interface: SessionImplementor
Execute a scroll() query

Specified by:
scroll in interface SessionImplementor
Throws:
HibernateException

afterScrollOperation

public void afterScrollOperation()
Specified by:
afterScrollOperation in interface SessionImplementor

flush

public void flush()
Specified by:
flush in interface SessionImplementor

getNonFlushedChanges

public NonFlushedChanges getNonFlushedChanges()
Description copied from interface: SessionImplementor
Return changes to this session that have not been flushed yet.

Specified by:
getNonFlushedChanges in interface SessionImplementor
Returns:
The non-flushed changes.

applyNonFlushedChanges

public void applyNonFlushedChanges(NonFlushedChanges nonFlushedChanges)
Description copied from interface: SessionImplementor
Apply non-flushed changes from a different session to this session. It is assumed that this SessionImpl is "clean" (e.g., has no non-flushed changes, no cached entities, no cached collections, no queued actions). The specified NonFlushedChanges object cannot be bound to any session.

Specified by:
applyNonFlushedChanges in interface SessionImplementor
Parameters:
nonFlushedChanges - the non-flushed changes

getFetchProfile

public String getFetchProfile()
Description copied from interface: SessionImplementor
Get the internal fetch profile currently associated with this session.

Specified by:
getFetchProfile in interface SessionImplementor
Returns:
The current internal fetch profile, or null if none currently associated.

getLoadQueryInfluencers

public LoadQueryInfluencers getLoadQueryInfluencers()
Description copied from interface: SessionImplementor
Get the load query influencers associated with this session.

Specified by:
getLoadQueryInfluencers in interface SessionImplementor
Returns:
the load query influencers associated with this session; should never be null.

setFetchProfile

public void setFetchProfile(String name)
Description copied from interface: SessionImplementor
Set the current internal fetch profile for this session.

Specified by:
setFetchProfile in interface SessionImplementor
Parameters:
name - The internal fetch profile name to use

executeNativeUpdate

public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification,
                               QueryParameters queryParameters)
                        throws HibernateException
Description copied from interface: SessionImplementor
Execute a native SQL update or delete query

Specified by:
executeNativeUpdate in interface SessionImplementor
Throws:
HibernateException


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.