Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » classic » [javadoc | source]
org.hibernate.classic
public interface: Session [javadoc | source]

All Implemented Interfaces:
    org.hibernate.Session

All Known Implementing Classes:
    SessionImpl

An extension of the Session API, including all deprecated methods from Hibernate2. This interface is provided to allow easier migration of existing applications. New code should use org.hibernate.Session.
Method from org.hibernate.classic.Session Summary:
createSQLQuery,   createSQLQuery,   delete,   delete,   delete,   filter,   filter,   filter,   find,   find,   find,   iterate,   iterate,   iterate,   save,   save,   saveOrUpdateCopy,   saveOrUpdateCopy,   saveOrUpdateCopy,   saveOrUpdateCopy,   update,   update
Method from org.hibernate.classic.Session Detail:
 public Query createSQLQuery(String sql,
    String returnAlias,
    Class returnClass)Deprecated! will -  be replaced with a more Query like interface in later release

    Create a new instance of Query for the given SQL string.
 public Query createSQLQuery(String sql,
    String[] returnAliases,
    Class[] returnClasses)Deprecated! will -  be replaced with a more Query like interface in later release

    Create a new instance of Query for the given SQL string.
 public int delete(String query) throws HibernateExceptionDeprecated! consider -  using HQL delete statements

    Delete all objects returned by the query. Return the number of objects deleted.

    Note that this is very different from the delete-statement support added in HQL since 3.1. The functionality here is to actually peform the query and then iterate the results calling #delete(Object) individually.

 public int delete(String query,
    Object value,
    Type type) throws HibernateExceptionDeprecated! consider -  using HQL delete statements

    Delete all objects returned by the query. Return the number of objects deleted.

    Note that this is very different from the delete-statement support added in HQL since 3.1. The functionality here is to actually peform the query and then iterate the results calling #delete(Object) individually.

 public int delete(String query,
    Object[] values,
    Type[] types) throws HibernateExceptionDeprecated! consider -  using HQL delete statements

    Delete all objects returned by the query. Return the number of objects deleted.

    Note that this is very different from the delete-statement support added in HQL since 3.1. The functionality here is to actually peform the query and then iterate the results calling #delete(Object) individually.

 public Collection filter(Object collection,
    String filter) throws HibernateExceptionDeprecated! use -  #createFilter(Object, String) .Query#list 

    Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to this, the collection element. Filters allow efficient access to very large lazy collections. (Executing the filter does not initialize the collection.)
 public Collection filter(Object collection,
    String filter,
    Object value,
    Type type) throws HibernateExceptionDeprecated! use -  #createFilter(Object, String) .setXYZ.Query#list 

    Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to this, the collection element.
 public Collection filter(Object collection,
    String filter,
    Object[] values,
    Type[] types) throws HibernateExceptionDeprecated! use -  #createFilter(Object, String) .setXYZ.Query#list 

    Apply a filter to a persistent collection. Bind the given parameters to "?" placeholders. A filter is a Hibernate query that may refer to this, the collection element.
 public List find(String query) throws HibernateExceptionDeprecated! use -  #createQuery .Query#list() 

    Execute a query.
 public List find(String query,
    Object value,
    Type type) throws HibernateExceptionDeprecated! use -  #createQuery .setXYZ.Query#list() 

    Execute a query with bind parameters, binding a value to a "?" parameter in the query string.
 public List find(String query,
    Object[] values,
    Type[] types) throws HibernateExceptionDeprecated! use -  #createQuery .setXYZ.Query#list() 

    Execute a query with bind parameters, binding an array of values to "?" parameters in the query string.
 public Iterator iterate(String query) throws HibernateExceptionDeprecated! use -  #createQuery .Query#iterate 

    Execute a query and return the results in an iterator. If the query has multiple return values, values will be returned in an array of type Object[].

    Entities returned as results are initialized on demand. The first SQL query returns identifiers only. So iterate() is usually a less efficient way to retrieve objects than find().
 public Iterator iterate(String query,
    Object value,
    Type type) throws HibernateExceptionDeprecated! use -  #createQuery .setXYZ.Query#iterate 

    Execute a query and return the results in an iterator. Write the given value to "?" in the query string. If the query has multiple return values, values will be returned in an array of type Object[].

    Entities returned as results are initialized on demand. The first SQL query returns identifiers only. So iterate() is usually a less efficient way to retrieve objects than find().
 public Iterator iterate(String query,
    Object[] values,
    Type[] types) throws HibernateExceptionDeprecated! use -  #createQuery .setXYZ.Query#iterate 

    Execute a query and return the results in an iterator. Write the given values to "?" in the query string. If the query has multiple return values, values will be returned in an array of type Object[].

    Entities returned as results are initialized on demand. The first SQL query returns identifiers only. So iterate() is usually a less efficient way to retrieve objects than find().
 public  void save(Object object,
    Serializable id) throws HibernateExceptionDeprecated! declare -  identifier properties for all classes

    Persist the given transient instance, using the given identifier. This operation cascades to associated instances if the association is mapped with cascade="save-update".
 public  void save(String entityName,
    Object object,
    Serializable id) throws HibernateExceptionDeprecated! declare -  identifier properties for all classes

    Persist the given transient instance, using the given identifier. This operation cascades to associated instances if the association is mapped with cascade="save-update".
 public Object saveOrUpdateCopy(Object object) throws HibernateExceptionDeprecated! use -  org.hibernate.Session#merge(Object) 

    Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved or does not exist in the database, save it and return it as a newly persistent instance. Otherwise, the given instance does not become associated with the session.
 public Object saveOrUpdateCopy(Object object,
    Serializable id) throws HibernateExceptionDeprecated! with -  no replacement

    Copy the state of the given object onto the persistent object with the given identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If there is no database row with the given identifier, save the given instance and return it as a newly persistent instance. Otherwise, the given instance does not become associated with the session.
 public Object saveOrUpdateCopy(String entityName,
    Object object) throws HibernateExceptionDeprecated! use -  org.hibernate.Session#merge(String, Object) 

    Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved or does not exist in the database, save it and return it as a newly persistent instance. Otherwise, the given instance does not become associated with the session.
 public Object saveOrUpdateCopy(String entityName,
    Object object,
    Serializable id) throws HibernateExceptionDeprecated! with -  no replacement

    Copy the state of the given object onto the persistent object with the given identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If there is no database row with the given identifier, save the given instance and return it as a newly persistent instance. Otherwise, the given instance does not become associated with the session.
 public  void update(Object object,
    Serializable id) throws HibernateExceptionDeprecated! declare -  identifier properties for all classes

    Update the persistent state associated with the given identifier. An exception is thrown if there is a persistent instance with the same identifier in the current session. This operation cascades to associated instances if the association is mapped with cascade="save-update".
 public  void update(String entityName,
    Object object,
    Serializable id) throws HibernateExceptionDeprecated! declare -  identifier properties for all classes

    Update the persistent state associated with the given identifier. An exception is thrown if there is a persistent instance with the same identifier in the current session. This operation cascades to associated instances if the association is mapped with cascade="save-update".