From: <one...@us...> - 2002-11-05 16:58:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory usw-pr-cvs1:/tmp/cvs-serv12927/cirrus/hibernate Modified Files: Session.java Log Message: removed deprecated methods in preparation for version 1.2 Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Session.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Session.java 24 Oct 2002 20:02:54 -0000 1.77 --- Session.java 5 Nov 2002 16:58:13 -0000 1.78 *************** *** 307,348 **** /** - * Execute a query, returning only the identifiers. - * - * @param query a query expressed in Hibernate's query language - * @return a distinct list of identifiers (or arrays of identifiers) - * @throws SQLException - * @throws HibernateException - */ - public List findIdentifiers(String query) throws SQLException, HibernateException; - - /** - * Execute a query, returning only the identifiers, binding a value to a "?" parameter - * in the query string. - * - * @param query the query string - * @param value a value to be bound to a "?" placeholder (JDBC IN parameter). - * @param type the Hibernate type of the value - * @see Hibernate for access to <tt>Type</tt> instances - * @return a distinct list of identifiers (or arrays of identifiers) - * @throws SQLException - * @throws HibernateException - */ - public List findIdentifiers(String query, Object value, Type type) throws SQLException, HibernateException; - - /** - * Execute a query, returning only the identifiers, binding an array of values to "?" parameters - * in the query string. - * - * @param query the query string - * @param values an array of values to be bound to the "?" placeholders (JDBC IN parameters). - * @param types an array of Hibernate types of the values - * @see Hibernate for access to <tt>Type</tt> instances - * @return a distinct list of identifiers (or arrays of identifiers) - * @throws SQLException - * @throws HibernateException - */ - public List findIdentifiers(String query, Object[] values, Type[] types) throws SQLException, HibernateException; - - /** * 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 <tt>Object[].</tt><br> --- 307,310 ---- *************** *** 549,585 **** /** - * Load the persistent instance of the given entity class with the given id, using an - * sql <tt>select .... for update</tt> (pessimistic locking). If <tt>for update</tt> is - * not supported by the underlying database, load the instance normally. If the instance - * is already loaded and <tt>for update</tt> is supported, <tt>lock()</tt> the instance. - * - * @deprecated use <tt>load()</tt>, specifying <tt>LockMode.UPGRADE</tt>. - * @param theClass a persistent class - * @param id a valid identifier of an existing persistent instance of the class - * @return the persistent instance - * @throws SQLException - * @throws HibernateException - */ - public Object loadWithLock(Class theClass, Serializable id) throws SQLException, HibernateException; - - /** - * Lock the given object for update (on the database) and check the version number. - * This is used to support a pessimistic locking strategy. If <tt>for update</tt> is - * not supported by the underlying database, do a simple version number check. - * - * @deprecated use <tt>lock()</tt>, specifying <tt>LockMode.UPGRADE</tt>. - * @param object a persistent instance - * @throws SQLException - * @throws HibernateException - */ - public void lock(Object object) throws SQLException, HibernateException; - - /** * Update the persistent instance with the identifier of the given transient * instance. If there is a persistent instance with the same identifier, * an exception is thrown.<br> * <br> ! * If the given transient instance has a null identifier, the session will ! * <tt>save()</tt> the instance with a generated identifier. This is useful * used in conjuction with cascading updates to persist a graph of transient * objects, some of which are newly instantiated.<br> --- 511,520 ---- /** * Update the persistent instance with the identifier of the given transient * instance. If there is a persistent instance with the same identifier, * an exception is thrown.<br> * <br> ! * If the given transient instance has a <tt>null</tt> identifier, the session ! * will <tt>save()</tt> the instance with a generated identifier. This is useful * used in conjuction with cascading updates to persist a graph of transient * objects, some of which are newly instantiated.<br> *************** *** 595,657 **** */ public void update(Object object) throws SQLException, HibernateException; ! /** ! * Persist the given transient instance, using the current value of its identifier property. ! * ! * @deprecated use <literal>save()</literal> together with an <literal>assigned</literal> ! * identifier generator. * ! * @param object a transient instance of a persistent class, with an initialized ! * identifier * @throws SQLException * @throws HibernateException */ ! public void insert(Object object) throws SQLException, HibernateException; /** ! * Persist the given transient instance, using the given identifier. * ! * @deprecated use the two-argument form of <literal>save()</literal>. * ! * @param object a transient instance of a persistent class ! * @param id an unused valid identifier * @throws SQLException * @throws HibernateException */ ! public void insert(Object object, Serializable id) throws SQLException, HibernateException; /** ! * Instantiate a persistent instance of an entity class. * ! * @deprecated instantiate the class yourself and use <tt>save()</tt>. ! * @param theClass ! * @return a persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public Object create(Class theClass) throws SQLException, HibernateException; ! ! /** ! * Create a persistent instance with an assigned identifier. * ! * @deprecated instantiate the class yourself and use <tt>save()</tt>. ! * @param theClass ! * @param id ! * @return a persistent instance * @throws SQLException * @throws HibernateException */ ! public Object create(Class theClass, Serializable id) throws SQLException, HibernateException; - /** - * Returns the identifier of an entity instance cached by the <tt>Session</tt>, or - * <tt>null</tt> if the instance is transient or associated with a different - * <tt>Session</tt>. - * - * @deprecated use <tt>getIdentifier()</tt> - * @param object a persistent instance - * @return the identifier - * @throws HibernateException if the <tt>Session</tt> is connected - */ - public Serializable getID(Object object) throws HibernateException; } --- 530,577 ---- */ public void update(Object object) throws SQLException, HibernateException; ! /** ! * Execute a query, returning only the identifiers. ! * ! * @deprecated use <tt>iterate("select foo.id from .....")</tt> * ! * @param query a query expressed in Hibernate's query language ! * @return a distinct list of identifiers (or arrays of identifiers) * @throws SQLException * @throws HibernateException */ ! public List findIdentifiers(String query) throws SQLException, HibernateException; /** ! * Execute a query, returning only the identifiers, binding a value to a "?" parameter ! * in the query string. * ! * @deprecated use <tt>iterate("select foo.id from .....")</tt> * ! * @param query the query string ! * @param value a value to be bound to a "?" placeholder (JDBC IN parameter). ! * @param type the Hibernate type of the value ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of identifiers (or arrays of identifiers) * @throws SQLException * @throws HibernateException */ ! public List findIdentifiers(String query, Object value, Type type) throws SQLException, HibernateException; /** ! * Execute a query, returning only the identifiers, binding an array of values to "?" parameters ! * in the query string. * ! * @deprecated use <tt>iterate("select foo.id from .....")</tt> * ! * @param query the query string ! * @param values an array of values to be bound to the "?" placeholders (JDBC IN parameters). ! * @param types an array of Hibernate types of the values ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of identifiers (or arrays of identifiers) * @throws SQLException * @throws HibernateException */ ! public List findIdentifiers(String query, Object[] values, Type[] types) throws SQLException, HibernateException; } |