Skip to content

Commit 94c05c5

Browse files
Apply NH-2284 (by Diego Mijelshon). Removes members that were marked obsolete in previous versions.
SVN: trunk@5161
1 parent 9b68b2b commit 94c05c5

File tree

4 files changed

+1
-277
lines changed

4 files changed

+1
-277
lines changed

src/NHibernate/Event/AbstractPreDatabaseOperationEvent.cs

-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,5 @@ protected AbstractPreDatabaseOperationEvent(IEventSource source, object entity,
3333
/// The persister for the <see cref="Entity"/>.
3434
/// </summary>
3535
public IEntityPersister Persister { get; private set; }
36-
37-
[Obsolete("Use Session property instead")]
38-
public ISessionImplementor Source
39-
{
40-
get { return Session; }
41-
}
4236
}
4337
}

src/NHibernate/ISession.cs

-160
Original file line numberDiff line numberDiff line change
@@ -488,146 +488,6 @@ public interface ISession : IDisposable
488488
/// <param name="obj">the instance to be removed </param>
489489
void Delete(string entityName, object obj);
490490

491-
/// <summary>
492-
/// Execute a query
493-
/// </summary>
494-
/// <param name="query">A query expressed in Hibernate's query language</param>
495-
/// <returns>A distinct list of instances</returns>
496-
/// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks>
497-
[Obsolete("Use ISession.CreateQuery().List()")]
498-
IList Find(string query);
499-
500-
/// <summary>
501-
/// Execute a query, binding a value to a "?" parameter in the query string.
502-
/// </summary>
503-
/// <param name="query">The query string</param>
504-
/// <param name="value">A value to be bound to a "?" placeholder</param>
505-
/// <param name="type">The Hibernate type of the value</param>
506-
/// <returns>A distinct list of instances</returns>
507-
/// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks>
508-
[Obsolete("Use ISession.CreateQuery().SetXYZ().List()")]
509-
IList Find(string query, object value, IType type);
510-
511-
/// <summary>
512-
/// Execute a query, binding an array of values to a "?" parameters in the query string.
513-
/// </summary>
514-
/// <param name="query">The query string</param>
515-
/// <param name="values">An array of values to be bound to the "?" placeholders</param>
516-
/// <param name="types">An array of Hibernate types of the values</param>
517-
/// <returns>A distinct list of instances</returns>
518-
/// <remarks>See <see cref="IQuery.List()"/> for implications of <c>cache</c> usage.</remarks>
519-
[Obsolete("Use ISession.CreateQuery().SetXYZ().List()")]
520-
IList Find(string query, object[] values, IType[] types);
521-
522-
/// <summary>
523-
/// Execute a query and return the results in an interator.
524-
/// </summary>
525-
/// <remarks>
526-
/// <para>
527-
/// If the query has multiple return values, values will be returned in an array of
528-
/// type <c>object[]</c>.
529-
/// </para>
530-
/// <para>
531-
/// Entities returned as results are initialized on demand. The first SQL query returns
532-
/// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve
533-
/// object than <c>List()</c>.
534-
/// </para>
535-
/// </remarks>
536-
/// <param name="query">The query string</param>
537-
/// <returns>An enumerator</returns>
538-
[Obsolete("Use ISession.CreateQuery().Enumerable()")]
539-
IEnumerable Enumerable(string query);
540-
541-
/// <summary>
542-
/// Execute a query and return the results in an interator,
543-
/// binding a value to a "?" parameter in the query string.
544-
/// </summary>
545-
/// <remarks>
546-
/// <para>
547-
/// If the query has multiple return values, values will be returned in an array of
548-
/// type <c>object[]</c>.
549-
/// </para>
550-
/// <para>
551-
/// Entities returned as results are initialized on demand. The first SQL query returns
552-
/// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve
553-
/// object than <c>List()</c>.
554-
/// </para>
555-
/// </remarks>
556-
/// <param name="query">The query string</param>
557-
/// <param name="value">A value to be written to a "?" placeholder in the query string</param>
558-
/// <param name="type">The hibernate type of the value</param>
559-
/// <returns>An enumerator</returns>
560-
[Obsolete("Use ISession.CreateQuery().SetXYZ().Enumerable()")]
561-
IEnumerable Enumerable(string query, object value, IType type);
562-
563-
/// <summary>
564-
/// Execute a query and return the results in an interator,
565-
/// binding the values to "?"s parameters in the query string.
566-
/// </summary>
567-
/// <remarks>
568-
/// <para>
569-
/// If the query has multiple return values, values will be returned in an array of
570-
/// type <c>object[]</c>.
571-
/// </para>
572-
/// <para>
573-
/// Entities returned as results are initialized on demand. The first SQL query returns
574-
/// identifiers only. So <c>Enumerator()</c> is usually a less efficient way to retrieve
575-
/// object than <c>List()</c>.
576-
/// </para>
577-
/// </remarks>
578-
/// <param name="query">The query string</param>
579-
/// <param name="values">A list of values to be written to "?" placeholders in the query</param>
580-
/// <param name="types">A list of hibernate types of the values</param>
581-
/// <returns>An enumerator</returns>
582-
[Obsolete("Use ISession.CreateQuery().SetXYZ().Enumerable()")]
583-
IEnumerable Enumerable(string query, object[] values, IType[] types);
584-
585-
/// <summary>
586-
/// Apply a filter to a persistent collection.
587-
/// </summary>
588-
/// <remarks>
589-
/// A filter is a Hibernate query that may refer to <c>this</c>, the collection element.
590-
/// Filters allow efficient access to very large lazy collections. (Executing the filter
591-
/// does not initialize the collection.)
592-
/// </remarks>
593-
/// <param name="collection">A persistent collection to filter</param>
594-
/// <param name="filter">A filter query string</param>
595-
/// <returns>The resulting collection</returns>
596-
[Obsolete("Use ISession.CreateFilter().List()")]
597-
ICollection Filter(object collection, string filter);
598-
599-
/// <summary>
600-
/// Apply a filter to a persistent collection, binding the given parameter to a "?" placeholder
601-
/// </summary>
602-
/// <remarks>
603-
/// A filter is a Hibernate query that may refer to <c>this</c>, the collection element.
604-
/// Filters allow efficient access to very large lazy collections. (Executing the filter
605-
/// does not initialize the collection.)
606-
/// </remarks>
607-
/// <param name="collection">A persistent collection to filter</param>
608-
/// <param name="filter">A filter query string</param>
609-
/// <param name="value">A value to be written to a "?" placeholder in the query</param>
610-
/// <param name="type">The hibernate type of value</param>
611-
/// <returns>A collection</returns>
612-
[Obsolete("Use ISession.CreateFilter().SetXYZ().List()")]
613-
ICollection Filter(object collection, string filter, object value, IType type);
614-
615-
/// <summary>
616-
/// Apply a filter to a persistent collection, binding the given parameters to "?" placeholders.
617-
/// </summary>
618-
/// <remarks>
619-
/// A filter is a Hibernate query that may refer to <c>this</c>, the collection element.
620-
/// Filters allow efficient access to very large lazy collections. (Executing the filter
621-
/// does not initialize the collection.)
622-
/// </remarks>
623-
/// <param name="collection">A persistent collection to filter</param>
624-
/// <param name="filter">A filter query string</param>
625-
/// <param name="values">The values to be written to "?" placeholders in the query</param>
626-
/// <param name="types">The hibernate types of the values</param>
627-
/// <returns>A collection</returns>
628-
[Obsolete("Use ISession.CreateFilter().SetXYZ().List()")]
629-
ICollection Filter(object collection, string filter, object[] values, IType[] types);
630-
631491
/// <summary>
632492
/// Delete all objects returned by the query.
633493
/// </summary>
@@ -830,26 +690,6 @@ public interface ISession : IDisposable
830690
/// </remarks>
831691
IQuery GetNamedQuery(string queryName);
832692

833-
/// <summary>
834-
/// Create a new instance of <c>IQuery</c> for the given SQL string.
835-
/// </summary>
836-
/// <param name="sql">a query expressed in SQL</param>
837-
/// <param name="returnAlias">a table alias that appears inside <c>{}</c> in the SQL string</param>
838-
/// <param name="returnClass">the returned persistent class</param>
839-
/// <returns>An <see cref="IQuery"/> from the SQL string</returns>
840-
[Obsolete("Use CreateSQLQuery().AddEntity()")]
841-
IQuery CreateSQLQuery(string sql, string returnAlias, System.Type returnClass);
842-
843-
/// <summary>
844-
/// Create a new instance of <see cref="IQuery" /> for the given SQL string.
845-
/// </summary>
846-
/// <param name="sql">a query expressed in SQL</param>
847-
/// <param name="returnAliases">an array of table aliases that appear inside <c>{}</c> in the SQL string</param>
848-
/// <param name="returnClasses">the returned persistent classes</param>
849-
/// <returns>An <see cref="IQuery"/> from the SQL string</returns>
850-
[Obsolete("Use CreateSQLQuery().AddEntity()")]
851-
IQuery CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses);
852-
853693
/// <summary>
854694
/// Create a new instance of <see cref="ISQLQuery" /> for the given SQL query string.
855695
/// </summary>

src/NHibernate/Impl/SessionImpl.cs

+1-99
Original file line numberDiff line numberDiff line change
@@ -559,28 +559,7 @@ public void Update(object obj, object id)
559559
private static readonly object[] NoArgs = new object[0];
560560
private static readonly IType[] NoTypes = new IType[0];
561561

562-
/// <summary>
563-
/// Retrieve a list of persistent objects using a Hibernate query
564-
/// </summary>
565-
/// <param name="query"></param>
566-
/// <returns></returns>
567-
public IList Find(string query)
568-
{
569-
using (new SessionIdLoggingContext(SessionId))
570-
{
571-
return List(query, new QueryParameters());
572-
}
573-
}
574-
575-
public IList Find(string query, object value, IType type)
576-
{
577-
using (new SessionIdLoggingContext(SessionId))
578-
{
579-
return List(query, new QueryParameters(type, value));
580-
}
581-
}
582-
583-
public IList Find(string query, object[] values, IType[] types)
562+
IList Find(string query, object[] values, IType[] types)
584563
{
585564
using (new SessionIdLoggingContext(SessionId))
586565
{
@@ -700,30 +679,6 @@ public override IQueryTranslator[] GetQueries(string query, bool scalar)
700679
}
701680
}
702681

703-
public IEnumerable Enumerable(string query)
704-
{
705-
using (new SessionIdLoggingContext(SessionId))
706-
{
707-
return Enumerable(query, NoArgs, NoTypes);
708-
}
709-
}
710-
711-
public IEnumerable Enumerable(string query, object value, IType type)
712-
{
713-
using (new SessionIdLoggingContext(SessionId))
714-
{
715-
return Enumerable(query, new[] { value }, new[] { type });
716-
}
717-
}
718-
719-
public IEnumerable Enumerable(string query, object[] values, IType[] types)
720-
{
721-
using (new SessionIdLoggingContext(SessionId))
722-
{
723-
return Enumerable(query, new QueryParameters(types, values));
724-
}
725-
}
726-
727682
public override IEnumerable<T> Enumerable<T>(string query, QueryParameters queryParameters)
728683
{
729684
using (new SessionIdLoggingContext(SessionId))
@@ -1760,39 +1715,6 @@ private void Dispose(bool isDisposing)
17601715

17611716
#endregion
17621717

1763-
public ICollection Filter(object collection, string filter)
1764-
{
1765-
using (new SessionIdLoggingContext(SessionId))
1766-
{
1767-
QueryParameters qp = new QueryParameters(new IType[1], new object[1]);
1768-
return ListFilter(collection, filter, qp);
1769-
}
1770-
}
1771-
1772-
public ICollection Filter(object collection, string filter, object value, IType type)
1773-
{
1774-
using (new SessionIdLoggingContext(SessionId))
1775-
{
1776-
QueryParameters qp = new QueryParameters(new IType[] { null, type }, new object[] { null, value });
1777-
return ListFilter(collection, filter, qp);
1778-
}
1779-
}
1780-
1781-
public ICollection Filter(object collection, string filter, object[] values, IType[] types)
1782-
{
1783-
using (new SessionIdLoggingContext(SessionId))
1784-
{
1785-
CheckAndUpdateSessionStatus();
1786-
1787-
object[] vals = new object[values.Length + 1];
1788-
IType[] typs = new IType[values.Length + 1];
1789-
Array.Copy(values, 0, vals, 1, values.Length);
1790-
Array.Copy(types, 0, typs, 1, types.Length);
1791-
QueryParameters qp = new QueryParameters(typs, vals);
1792-
return ListFilter(collection, filter, qp);
1793-
}
1794-
}
1795-
17961718
private void Filter(object collection, string filter, QueryParameters queryParameters, IList results)
17971719
{
17981720
using (new SessionIdLoggingContext(SessionId))
@@ -2083,26 +2005,6 @@ public override ISQLQuery CreateSQLQuery(string sql)
20832005
}
20842006
}
20852007

2086-
public IQuery CreateSQLQuery(string sql, string returnAlias, System.Type returnClass)
2087-
{
2088-
using (new SessionIdLoggingContext(SessionId))
2089-
{
2090-
CheckAndUpdateSessionStatus();
2091-
return new SqlQueryImpl(sql, new[] { returnAlias }, new[] { returnClass }, this,
2092-
Factory.QueryPlanCache.GetSQLParameterMetadata(sql));
2093-
}
2094-
}
2095-
2096-
public IQuery CreateSQLQuery(string sql, string[] returnAliases, System.Type[] returnClasses)
2097-
{
2098-
using (new SessionIdLoggingContext(SessionId))
2099-
{
2100-
CheckAndUpdateSessionStatus();
2101-
return new SqlQueryImpl(sql, returnAliases, returnClasses, this,
2102-
Factory.QueryPlanCache.GetSQLParameterMetadata(sql));
2103-
}
2104-
}
2105-
21062008
public override IList List(NativeSQLQuerySpecification spec, QueryParameters queryParameters)
21072009
{
21082010
using (new SessionIdLoggingContext(SessionId))

src/NHibernate/NHibernateUtil.cs

-12
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,6 @@ public static IType Any(IType metaType, IType identifierType)
312312
return new AnyType(metaType, identifierType);
313313
}
314314

315-
/// <summary>
316-
/// A NHibernate persistent object (entity) type
317-
/// </summary>
318-
/// <param name="persistentClass">a mapped entity class</param>
319-
/// <returns></returns>
320-
[Obsolete("use NHibernate.Entity instead")]
321-
public static IType Association(System.Type persistentClass)
322-
{
323-
// not really a many-to-one association *necessarily*
324-
return new ManyToOneType(persistentClass.FullName);
325-
}
326-
327315
/// <summary>
328316
/// A NHibernate persistent object (entity) type
329317
/// </summary>

0 commit comments

Comments
 (0)