From: <jul...@us...> - 2010-08-16 14:02:07
|
Revision: 5161 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5161&view=rev Author: julian-maughan Date: 2010-08-16 14:02:01 +0000 (Mon, 16 Aug 2010) Log Message: ----------- Apply NH-2284 (by Diego Mijelshon). Removes members that were marked obsolete in previous versions. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Event/AbstractPreDatabaseOperationEvent.cs trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/NHibernateUtil.cs Modified: trunk/nhibernate/src/NHibernate/Event/AbstractPreDatabaseOperationEvent.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Event/AbstractPreDatabaseOperationEvent.cs 2010-08-15 16:31:51 UTC (rev 5160) +++ trunk/nhibernate/src/NHibernate/Event/AbstractPreDatabaseOperationEvent.cs 2010-08-16 14:02:01 UTC (rev 5161) @@ -33,11 +33,5 @@ /// The persister for the <see cref="Entity"/>. /// </summary> public IEntityPersister Persister { get; private set; } - - [Obsolete("Use Session property instead")] - public ISessionImplementor Source - { - get { return Session; } - } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2010-08-15 16:31:51 UTC (rev 5160) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2010-08-16 14:02:01 UTC (rev 5161) @@ -489,146 +489,6 @@ void Delete(string entityName, object obj); /// <summary> - /// Execute a query - /// </summary> - /// <param name="query">A query expressed in Hibernate's query language</param> - /// <returns>A distinct list of instances</returns> - /// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks> - [Obsolete("Use ISession.CreateQuery().List()")] - IList Find(string query); - - /// <summary> - /// Execute a query, binding a value to a "?" parameter in the query string. - /// </summary> - /// <param name="query">The query string</param> - /// <param name="value">A value to be bound to a "?" placeholder</param> - /// <param name="type">The Hibernate type of the value</param> - /// <returns>A distinct list of instances</returns> - /// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks> - [Obsolete("Use ISession.CreateQuery().SetXYZ().List()")] - IList Find(string query, object value, IType type); - - /// <summary> - /// Execute a query, binding an array of values to a "?" parameters in the query string. - /// </summary> - /// <param name="query">The query string</param> - /// <param name="values">An array of values to be bound to the "?" placeholders</param> - /// <param name="types">An array of Hibernate types of the values</param> - /// <returns>A distinct list of instances</returns> - /// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks> - [Obsolete("Use ISession.CreateQuery().SetXYZ().List()")] - IList Find(string query, object[] values, IType[] types); - - /// <summary> - /// Execute a query and return the results in an interator. - /// </summary> - /// <remarks> - /// <para> - /// If the query has multiple return values, values will be returned in an array of - /// type <c>object[]</c>. - /// </para> - /// <para> - /// Entities returned as results are initialized on demand. The first SQL query returns - /// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve - /// object than <c>List()</c>. - /// </para> - /// </remarks> - /// <param name="query">The query string</param> - /// <returns>An enumerator</returns> - [Obsolete("Use ISession.CreateQuery().Enumerable()")] - IEnumerable Enumerable(string query); - - /// <summary> - /// Execute a query and return the results in an interator, - /// binding a value to a "?" parameter in the query string. - /// </summary> - /// <remarks> - /// <para> - /// If the query has multiple return values, values will be returned in an array of - /// type <c>object[]</c>. - /// </para> - /// <para> - /// Entities returned as results are initialized on demand. The first SQL query returns - /// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve - /// object than <c>List()</c>. - /// </para> - /// </remarks> - /// <param name="query">The query string</param> - /// <param name="value">A value to be written to a "?" placeholder in the query string</param> - /// <param name="type">The hibernate type of the value</param> - /// <returns>An enumerator</returns> - [Obsolete("Use ISession.CreateQuery().SetXYZ().Enumerable()")] - IEnumerable Enumerable(string query, object value, IType type); - - /// <summary> - /// Execute a query and return the results in an interator, - /// binding the values to "?"s parameters in the query string. - /// </summary> - /// <remarks> - /// <para> - /// If the query has multiple return values, values will be returned in an array of - /// type <c>object[]</c>. - /// </para> - /// <para> - /// Entities returned as results are initialized on demand. The first SQL query returns - /// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve - /// object than <c>List()</c>. - /// </para> - /// </remarks> - /// <param name="query">The query string</param> - /// <param name="values">A list of values to be written to "?" placeholders in the query</param> - /// <param name="types">A list of hibernate types of the values</param> - /// <returns>An enumerator</returns> - [Obsolete("Use ISession.CreateQuery().SetXYZ().Enumerable()")] - IEnumerable Enumerable(string query, object[] values, IType[] types); - - /// <summary> - /// Apply a filter to a persistent collection. - /// </summary> - /// <remarks> - /// A filter is a Hibernate query that may refer to <c>this</c>, the collection element. - /// Filters allow efficient access to very large lazy collections. (Executing the filter - /// does not initialize the collection.) - /// </remarks> - /// <param name="collection">A persistent collection to filter</param> - /// <param name="filter">A filter query string</param> - /// <returns>The resulting collection</returns> - [Obsolete("Use ISession.CreateFilter().List()")] - ICollection Filter(object collection, string filter); - - /// <summary> - /// Apply a filter to a persistent collection, binding the given parameter to a "?" placeholder - /// </summary> - /// <remarks> - /// A filter is a Hibernate query that may refer to <c>this</c>, the collection element. - /// Filters allow efficient access to very large lazy collections. (Executing the filter - /// does not initialize the collection.) - /// </remarks> - /// <param name="collection">A persistent collection to filter</param> - /// <param name="filter">A filter query string</param> - /// <param name="value">A value to be written to a "?" placeholder in the query</param> - /// <param name="type">The hibernate type of value</param> - /// <returns>A collection</returns> - [Obsolete("Use ISession.CreateFilter().SetXYZ().List()")] - ICollection Filter(object collection, string filter, object value, IType type); - - /// <summary> - /// Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. - /// </summary> - /// <remarks> - /// A filter is a Hibernate query that may refer to <c>this</c>, the collection element. - /// Filters allow efficient access to very large lazy collections. (Executing the filter - /// does not initialize the collection.) - /// </remarks> - /// <param name="collection">A persistent collection to filter</param> - /// <param name="filter">A filter query string</param> - /// <param name="values">The values to be written to "?" placeholders in the query</param> - /// <param name="types">The hibernate types of the values</param> - /// <returns>A collection</returns> - [Obsolete("Use ISession.CreateFilter().SetXYZ().List()")] - ICollection Filter(object collection, string filter, object[] values, IType[] types); - - /// <summary> /// Delete all objects returned by the query. /// </summary> /// <param name="query">The query string</param> @@ -831,26 +691,6 @@ IQuery GetNamedQuery(string queryName); /// <summary> - /// Create a new instance of <c>IQuery</c> for the given SQL string. - /// </summary> - /// <param name="sql">a query expressed in SQL</param> - /// <param name="returnAlias">a table alias that appears inside <c>{}</c> in the SQL string</param> - /// <param name="returnClass">the returned persistent class</param> - /// <returns>An <see cref="IQuery"/> from the SQL string</returns> - [Obsolete("Use CreateSQLQuery().AddEntity()")] - IQuery CreateSQLQuery(string sql, string returnAlias, System.Type returnClass); - - /// <summary> - /// Create a new instance of <see cref="IQuery" /> for the given SQL string. - /// </summary> - /// <param name="sql">a query expressed in SQL</param> - /// <param name="returnAliases">an array of table aliases that appear inside <c>{}</c> in the SQL string</param> - /// <param name="returnClasses">the returned persistent classes</param> - /// <returns>An <see cref="IQuery"/> from the SQL string</returns> - [Obsolete("Use CreateSQLQuery().AddEntity()")] - IQuery CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses); - - /// <summary> /// Create a new instance of <see cref="ISQLQuery" /> for the given SQL query string. /// </summary> /// <param name="queryString">a query expressed in SQL</param> Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2010-08-15 16:31:51 UTC (rev 5160) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2010-08-16 14:02:01 UTC (rev 5161) @@ -559,31 +559,10 @@ private static readonly object[] NoArgs = new object[0]; private static readonly IType[] NoTypes = new IType[0]; - /// <summary> - /// Retrieve a list of persistent objects using a Hibernate query - /// </summary> - /// <param name="query"></param> - /// <returns></returns> - public IList Find(string query) + IList Find(string query, object[] values, IType[] types) { using (new SessionIdLoggingContext(SessionId)) { - return List(query, new QueryParameters()); - } - } - - public IList Find(string query, object value, IType type) - { - using (new SessionIdLoggingContext(SessionId)) - { - return List(query, new QueryParameters(type, value)); - } - } - - public IList Find(string query, object[] values, IType[] types) - { - using (new SessionIdLoggingContext(SessionId)) - { return List(query, new QueryParameters(types, values)); } } @@ -700,30 +679,6 @@ } } - public IEnumerable Enumerable(string query) - { - using (new SessionIdLoggingContext(SessionId)) - { - return Enumerable(query, NoArgs, NoTypes); - } - } - - public IEnumerable Enumerable(string query, object value, IType type) - { - using (new SessionIdLoggingContext(SessionId)) - { - return Enumerable(query, new[] { value }, new[] { type }); - } - } - - public IEnumerable Enumerable(string query, object[] values, IType[] types) - { - using (new SessionIdLoggingContext(SessionId)) - { - return Enumerable(query, new QueryParameters(types, values)); - } - } - public override IEnumerable<T> Enumerable<T>(string query, QueryParameters queryParameters) { using (new SessionIdLoggingContext(SessionId)) @@ -1760,39 +1715,6 @@ #endregion - public ICollection Filter(object collection, string filter) - { - using (new SessionIdLoggingContext(SessionId)) - { - QueryParameters qp = new QueryParameters(new IType[1], new object[1]); - return ListFilter(collection, filter, qp); - } - } - - public ICollection Filter(object collection, string filter, object value, IType type) - { - using (new SessionIdLoggingContext(SessionId)) - { - QueryParameters qp = new QueryParameters(new IType[] { null, type }, new object[] { null, value }); - return ListFilter(collection, filter, qp); - } - } - - public ICollection Filter(object collection, string filter, object[] values, IType[] types) - { - using (new SessionIdLoggingContext(SessionId)) - { - CheckAndUpdateSessionStatus(); - - object[] vals = new object[values.Length + 1]; - IType[] typs = new IType[values.Length + 1]; - Array.Copy(values, 0, vals, 1, values.Length); - Array.Copy(types, 0, typs, 1, types.Length); - QueryParameters qp = new QueryParameters(typs, vals); - return ListFilter(collection, filter, qp); - } - } - private void Filter(object collection, string filter, QueryParameters queryParameters, IList results) { using (new SessionIdLoggingContext(SessionId)) @@ -2083,26 +2005,6 @@ } } - public IQuery CreateSQLQuery(string sql, string returnAlias, System.Type returnClass) - { - using (new SessionIdLoggingContext(SessionId)) - { - CheckAndUpdateSessionStatus(); - return new SqlQueryImpl(sql, new[] { returnAlias }, new[] { returnClass }, this, - Factory.QueryPlanCache.GetSQLParameterMetadata(sql)); - } - } - - public IQuery CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses) - { - using (new SessionIdLoggingContext(SessionId)) - { - CheckAndUpdateSessionStatus(); - return new SqlQueryImpl(sql, returnAliases, returnClasses, this, - Factory.QueryPlanCache.GetSQLParameterMetadata(sql)); - } - } - public override IList List(NativeSQLQuerySpecification spec, QueryParameters queryParameters) { using (new SessionIdLoggingContext(SessionId)) Modified: trunk/nhibernate/src/NHibernate/NHibernateUtil.cs =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernateUtil.cs 2010-08-15 16:31:51 UTC (rev 5160) +++ trunk/nhibernate/src/NHibernate/NHibernateUtil.cs 2010-08-16 14:02:01 UTC (rev 5161) @@ -317,18 +317,6 @@ /// </summary> /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> - [Obsolete("use NHibernate.Entity instead")] - public static IType Association(System.Type persistentClass) - { - // not really a many-to-one association *necessarily* - return new ManyToOneType(persistentClass.FullName); - } - - /// <summary> - /// A NHibernate persistent object (entity) type - /// </summary> - /// <param name="persistentClass">a mapped entity class</param> - /// <returns></returns> public static IType Entity(System.Type persistentClass) { // not really a many-to-one association *necessarily* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |