Save This Page
Home » Hibernate-3.3.2.GA » org.hibernate » impl » [javadoc | source]
org.hibernate.impl
public final class: SessionImpl [javadoc | source]
java.lang.Object
   org.hibernate.impl.AbstractSessionImpl
      org.hibernate.impl.SessionImpl

All Implemented Interfaces:
    EventSource, Session, Context, SessionImplementor

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.
Fields inherited from org.hibernate.impl.AbstractSessionImpl:
factory
Constructor:
 SessionImpl(Connection connection,
    SessionFactoryImpl factory,
    boolean autoclose,
    long timestamp,
    Interceptor interceptor,
    EntityMode entityMode,
    boolean flushBeforeCompletionEnabled,
    boolean autoCloseSessionEnabled,
    ConnectionReleaseMode connectionReleaseMode) 
    Constructor used for openSession(...) processing, as well as construction of sessions for getCurrentSession().
    Parameters:
    connection - The user-supplied connection to use for this session.
    factory - The factory from which this session was obtained
    autoclose - NOT USED
    timestamp - The timestamp for this session
    interceptor - The interceptor to be applied to this session
    entityMode - The entity-mode for this session
    flushBeforeCompletionEnabled - Should we auto flush before completion of transaction
    autoCloseSessionEnabled - Should we auto close after completion of transaction
    connectionReleaseMode - The mode by which we should release JDBC connections.
Method from org.hibernate.impl.SessionImpl Summary:
afterOperation,   afterScrollOperation,   afterTransactionBegin,   afterTransactionCompletion,   autoFlushIfRequired,   beforeTransactionCompletion,   beginTransaction,   bestGuessEntityName,   cancelQuery,   clear,   close,   connection,   contains,   createCriteria,   createCriteria,   createCriteria,   createCriteria,   createFilter,   createQuery,   createSQLQuery,   createSQLQuery,   createSQLQuery,   delete,   delete,   delete,   delete,   delete,   delete,   disableFilter,   disconnect,   doWork,   enableFilter,   evict,   executeNativeUpdate,   executeUpdate,   filter,   filter,   filter,   find,   find,   find,   flush,   forceFlush,   get,   get,   get,   get,   getActionQueue,   getBatcher,   getCacheMode,   getConnectionReleaseMode,   getContextEntityIdentifier,   getCurrentLockMode,   getDontFlushFromFind,   getEnabledFilter,   getEnabledFilters,   getEntityMode,   getEntityName,   getEntityPersister,   getEntityUsingInterceptor,   getFetchProfile,   getFilterParameterType,   getFilterParameterValue,   getFlushMode,   getIdentifier,   getInterceptor,   getJDBCContext,   getListeners,   getNamedQuery,   getPersistenceContext,   getSession,   getSessionFactory,   getStatistics,   getTimestamp,   getTransaction,   guessEntityName,   immediateLoad,   initializeCollection,   instantiate,   instantiate,   internalLoad,   isAutoCloseSessionEnabled,   isConnected,   isDirty,   isEventSource,   isFlushBeforeCompletionEnabled,   isFlushModeNever,   isOpen,   isTransactionInProgress,   iterate,   iterate,   iterate,   iterate,   iterateFilter,   list,   list,   listCustomQuery,   listFilter,   load,   load,   load,   load,   load,   lock,   lock,   managedClose,   managedFlush,   merge,   merge,   merge,   persist,   persist,   persist,   persistOnFlush,   persistOnFlush,   persistOnFlush,   reconnect,   reconnect,   refresh,   refresh,   refresh,   replicate,   replicate,   save,   save,   save,   save,   saveOrUpdate,   saveOrUpdate,   saveOrUpdateCopy,   saveOrUpdateCopy,   saveOrUpdateCopy,   saveOrUpdateCopy,   saveOrUpdateCopy,   scroll,   scroll,   scrollCustomQuery,   setAutoClear,   setCacheMode,   setFetchProfile,   setFlushMode,   setReadOnly,   shouldAutoClose,   toString,   update,   update,   update,   update
Methods from org.hibernate.impl.AbstractSessionImpl:
createQuery,   createSQLQuery,   errorIfClosed,   getFactory,   getHQLQueryPlan,   getNamedQuery,   getNamedSQLQuery,   getNativeSQLQueryPlan,   isClosed,   list,   scroll,   setClosed
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.impl.SessionImpl Detail:
 public  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
 public  void afterScrollOperation() 
 public  void afterTransactionBegin(Transaction tx) 
 public  void afterTransactionCompletion(boolean success,
    Transaction tx) 
 protected boolean autoFlushIfRequired(Set querySpaces) throws HibernateException 
    detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush
 public  void beforeTransactionCompletion(Transaction tx) 
 public Transaction beginTransaction() throws HibernateException 
 public String bestGuessEntityName(Object object) 
 public  void cancelQuery() throws HibernateException 
 public  void clear() 
 public Connection close() throws HibernateException 
 public Connection connection() throws HibernateException 
 public boolean contains(Object object) 
 public Criteria createCriteria(Class persistentClass) 
 public Criteria createCriteria(String entityName) 
 public Criteria createCriteria(Class persistentClass,
    String alias) 
 public Criteria createCriteria(String entityName,
    String alias) 
 public Query createFilter(Object collection,
    String queryString) 
 public Query createQuery(String queryString) 
 public SQLQuery createSQLQuery(String sql) 
 public Query createSQLQuery(String sql,
    String returnAlias,
    Class returnClass) 
 public Query createSQLQuery(String sql,
    String[] returnAliases,
    Class[] returnClasses) 
 public  void delete(Object object) throws HibernateException 
    Delete a persistent object
 public int delete(String query) throws HibernateException 
 public  void delete(String entityName,
    Object object) throws HibernateException 
    Delete a persistent object (by explicit entity name)
 public int delete(String query,
    Object value,
    Type type) throws HibernateException 
 public int delete(String query,
    Object[] values,
    Type[] types) throws HibernateException 
 public  void delete(String entityName,
    Object object,
    boolean isCascadeDeleteEnabled,
    Set transientEntities) throws HibernateException 
    Delete a persistent object
 public  void disableFilter(String filterName) 
 public Connection disconnect() throws HibernateException 
 public  void doWork(Work work) throws HibernateException 
 public Filter enableFilter(String filterName) 
 public  void evict(Object object) throws HibernateException 
    remove any hard references to the entity that are held by the infrastructure (references held by application or other persistant instances are okay)
 public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification,
    QueryParameters queryParameters) throws HibernateException 
 public int executeUpdate(String query,
    QueryParameters queryParameters) throws HibernateException 
 public Collection filter(Object collection,
    String filter) throws HibernateException 
 public Collection filter(Object collection,
    String filter,
    Object value,
    Type type) throws HibernateException 
 public Collection filter(Object collection,
    String filter,
    Object[] values,
    Type[] types) throws HibernateException 
 public List find(String query) throws HibernateException 
    Retrieve a list of persistent objects using a hibernate query
 public List find(String query,
    Object value,
    Type type) throws HibernateException 
 public List find(String query,
    Object[] values,
    Type[] types) throws HibernateException 
 public  void flush() throws HibernateException 
 public  void forceFlush(EntityEntry entityEntry) throws HibernateException 
 public Object get(Class entityClass,
    Serializable id) throws HibernateException 
 public Object get(String entityName,
    Serializable id) throws HibernateException 
 public Object get(Class entityClass,
    Serializable id,
    LockMode lockMode) throws HibernateException 
 public Object get(String entityName,
    Serializable id,
    LockMode lockMode) throws HibernateException 
 public ActionQueue getActionQueue() 
 public Batcher getBatcher() 
 public CacheMode getCacheMode() 
 public ConnectionReleaseMode getConnectionReleaseMode() 
 public Serializable getContextEntityIdentifier(Object object) 
    Get the id value for an object that is actually associated with the session. This is a bit stricter than getEntityIdentifierIfNotUnsaved().
 public LockMode getCurrentLockMode(Object object) throws HibernateException 
 public int getDontFlushFromFind() 
 public Filter getEnabledFilter(String filterName) 
 public Map getEnabledFilters() 
 public EntityMode getEntityMode() 
 public String getEntityName(Object object) 
 public EntityPersister getEntityPersister(String entityName,
    Object object) 
 public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException 
 public String getFetchProfile() 
 public Type getFilterParameterType(String filterParameterName) 
 public Object getFilterParameterValue(String filterParameterName) 
 public FlushMode getFlushMode() 
 public Serializable getIdentifier(Object object) throws HibernateException 
 public Interceptor getInterceptor() 
 public JDBCContext getJDBCContext() 
 public EventListeners getListeners() 
 public Query getNamedQuery(String queryName) throws MappingException 
 public PersistenceContext getPersistenceContext() 
 public Session getSession(EntityMode entityMode) 
 public SessionFactory getSessionFactory() 
 public SessionStatistics getStatistics() 
 public long getTimestamp() 
 public Transaction getTransaction() throws HibernateException 
 public String guessEntityName(Object object) throws HibernateException 
 public Object immediateLoad(String entityName,
    Serializable id) throws HibernateException 
    Load the data for the object with the specified id into a newly created object. This is only called when lazily initializing a proxy. Do NOT return a proxy.
 public  void initializeCollection(PersistentCollection collection,
    boolean writing) throws HibernateException 
 public Object instantiate(String entityName,
    Serializable id) throws HibernateException 
 public Object instantiate(EntityPersister persister,
    Serializable id) throws HibernateException 
    give the interceptor an opportunity to override the default instantiation
 public Object internalLoad(String entityName,
    Serializable id,
    boolean eager,
    boolean nullable) throws HibernateException 
 public boolean isAutoCloseSessionEnabled() 
 public boolean isConnected() 
 public boolean isDirty() throws HibernateException 
 public boolean isEventSource() 
 public boolean isFlushBeforeCompletionEnabled() 
 public boolean isFlushModeNever() 
 public boolean isOpen() 
 public boolean isTransactionInProgress() 
 public Iterator iterate(String query) throws HibernateException 
 public Iterator iterate(String query,
    QueryParameters queryParameters) throws HibernateException 
 public Iterator iterate(String query,
    Object value,
    Type type) throws HibernateException 
 public Iterator iterate(String query,
    Object[] values,
    Type[] types) throws HibernateException 
 public Iterator iterateFilter(Object collection,
    String filter,
    QueryParameters queryParameters) throws HibernateException 
 public List list(CriteriaImpl criteria) throws HibernateException 
 public List list(String query,
    QueryParameters queryParameters) throws HibernateException 
 public List listCustomQuery(CustomQuery customQuery,
    QueryParameters queryParameters) throws HibernateException 
 public List listFilter(Object collection,
    String filter,
    QueryParameters queryParameters) throws HibernateException 
 public  void load(Object object,
    Serializable id) throws HibernateException 
 public Object load(Class entityClass,
    Serializable id) throws HibernateException 
 public Object load(String entityName,
    Serializable id) throws HibernateException 
 public Object load(Class entityClass,
    Serializable id,
    LockMode lockMode) throws HibernateException 
 public Object load(String entityName,
    Serializable id,
    LockMode lockMode) throws HibernateException 
 public  void lock(Object object,
    LockMode lockMode) throws HibernateException 
 public  void lock(String entityName,
    Object object,
    LockMode lockMode) throws HibernateException 
 public  void managedClose() 
 public  void managedFlush() 
 public Object merge(Object object) throws HibernateException 
 public Object merge(String entityName,
    Object object) throws HibernateException 
 public  void merge(String entityName,
    Object object,
    Map copiedAlready) throws HibernateException 
 public  void persist(Object object) throws HibernateException 
 public  void persist(String entityName,
    Object object) throws HibernateException 
 public  void persist(String entityName,
    Object object,
    Map copiedAlready) throws HibernateException 
 public  void persistOnFlush(Object object) throws HibernateException 
 public  void persistOnFlush(String entityName,
    Object object) throws HibernateException 
 public  void persistOnFlush(String entityName,
    Object object,
    Map copiedAlready) throws HibernateException 
 public  void reconnect() throws HibernateException 
 public  void reconnect(Connection conn) throws HibernateException 
 public  void refresh(Object object) throws HibernateException 
 public  void refresh(Object object,
    LockMode lockMode) throws HibernateException 
 public  void refresh(Object object,
    Map refreshedAlready) throws HibernateException 
 public  void replicate(Object obj,
    ReplicationMode replicationMode) throws HibernateException 
 public  void replicate(String entityName,
    Object obj,
    ReplicationMode replicationMode) throws HibernateException 
 public Serializable save(Object obj) throws HibernateException 
 public  void save(Object obj,
    Serializable id) throws HibernateException 
 public Serializable save(String entityName,
    Object object) throws HibernateException 
 public  void save(String entityName,
    Object object,
    Serializable id) throws HibernateException 
 public  void saveOrUpdate(Object object) throws HibernateException 
 public  void saveOrUpdate(String entityName,
    Object obj) throws HibernateException 
 public Object saveOrUpdateCopy(Object object) throws HibernateException 
 public Object saveOrUpdateCopy(String entityName,
    Object object) throws HibernateException 
 public Object saveOrUpdateCopy(Object object,
    Serializable id) throws HibernateException 
 public Object saveOrUpdateCopy(String entityName,
    Object object,
    Serializable id) throws HibernateException 
 public  void saveOrUpdateCopy(String entityName,
    Object object,
    Map copiedAlready) throws HibernateException 
 public ScrollableResults scroll(String query,
    QueryParameters queryParameters) throws HibernateException 
 public ScrollableResults scroll(CriteriaImpl criteria,
    ScrollMode scrollMode) 
 public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
    QueryParameters queryParameters) throws HibernateException 
 public  void setAutoClear(boolean enabled) 
 public  void setCacheMode(CacheMode cacheMode) 
 public  void setFetchProfile(String fetchProfile) 
 public  void setFlushMode(FlushMode flushMode) 
 public  void setReadOnly(Object entity,
    boolean readOnly) 
 public boolean shouldAutoClose() 
 public String toString() 
 public  void update(Object obj) throws HibernateException 
 public  void update(Object obj,
    Serializable id) throws HibernateException 
 public  void update(String entityName,
    Object object) throws HibernateException 
 public  void update(String entityName,
    Object object,
    Serializable id) throws HibernateException