不同,hibernate中的session是org.hibernate.Session;的对象://$Id: Session.java,v 1.8 2004/08/09 14:35:17 steveebersole Exp $
package org.hibernate;import java.io.Serializable;
import java.sql.Connection;
public interface Session extends Serializable {
public void flush() throws HibernateException;
public void setFlushMode(FlushMode flushMode); /**
 * Get the current flush mode.
 *
 * @return FlushMode
 */
public FlushMode getFlushMode(); /**
 * Get the <tt>SessionFactory</tt> that created this instance.
 * @see SessionFactory
 */
public SessionFactory getSessionFactory(); /**
 * Get the JDBC connection. Applications are responsible for
 * calling commit/rollback upon the connection before closing
 * the <tt>Session</tt>.
 *
 * @return the JDBC connection in use by the <tt>Session</tt>
 * @throws HibernateException if the <tt>Session</tt> is disconnected
 */
public Connection connection() throws HibernateException;
public Connection disconnect() throws HibernateException; /**
 * Obtain a new JDBC connection. This is used by applications which
 * require long transactions.
 *
 * @see Session#disconnect()
 * @throws HibernateException
 */
public void reconnect() throws HibernateException;
public void reconnect(Connection connection) throws HibernateException;
public Connection close() throws HibernateException;
public void cancelQuery() throws HibernateException; /**
 * Check if the <tt>Session</tt> is still open.
 *
 * @return boolean
 */
public boolean isOpen(); /**
 * Check if the <tt>Session</tt> is currently connected.
 *
 * @return boolean
 */
public boolean isConnected(); /**
 * Does this <tt>Session</tt> contain any changes which must be
 * synchronized with the database? Would any SQL be executed if
 * we flushed this session?
 *
 * @return boolean
 */
public boolean isDirty() throws HibernateException;
public Serializable getIdentifier(Object object) throws HibernateException;

public boolean contains(Object object);

public void evict(Object object) throws HibernateException; /**
 * Return the persistent instance of the given entity class with the given identifier,
 * obtaining the specified lock mode, assuming the instance exists.
 *
 * @param theClass a persistent class
 * @param id a valid identifier of an existing persistent instance of the class
 * @param lockMode the lock level
 * @return the persistent instance or proxy
 * @throws HibernateException
 */
public Object load(Class theClass, Serializable id, LockMode lockMode) throws HibernateException; /**
 * Return the persistent instance of the given entity class with the given identifier,
 * obtaining the specified lock mode, assuming the instance exists.
 *
 * @param entityName a persistent class
 * @param id a valid identifier of an existing persistent instance of the class
 * @param lockMode the lock level
 * @return the persistent instance or proxy
 * @throws HibernateException
 */
public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException;
public Object load(Class theClass, Serializable id) throws HibernateException;
public Object load(String entityName, Serializable id) throws HibernateException;
public void load(Object object, Serializable id) throws HibernateException;
public void replicate(Object object, ReplicationMode replicationMode) throws HibernateException;
public void replicate(String entityName, Object object, ReplicationMode replicationMode) throws HibernateException;
public Serializable save(Object object) throws HibernateException; .............. public void disableFilter(String filterName);}