onetomanyloader.cs

来自「NHibernate NET开发者所需的」· CS 代码 · 共 59 行

CS
59
字号
using System.Collections.Generic;
using log4net;
using NHibernate.Engine;
using NHibernate.Persister.Collection;
using NHibernate.SqlCommand;

namespace NHibernate.Loader.Collection
{
	/// <summary>
	/// Loads one-to-many associations
	/// </summary>
	/// <remarks>
	/// The collection persister must implement <see cref="IQueryableCollection" />.
	/// For other collections, create a customized subclass of <see cref="Loader" />.
	/// </remarks>
	public class OneToManyLoader : CollectionLoader
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(OneToManyLoader));

		public OneToManyLoader(
			IQueryableCollection oneToManyPersister,
			ISessionFactoryImplementor session,
			IDictionary<string, IFilter> enabledFilters)
			: this(oneToManyPersister, 1, session, enabledFilters)
		{
		}

		public OneToManyLoader(
			IQueryableCollection oneToManyPersister,
			int batchSize,
			ISessionFactoryImplementor factory,
			IDictionary<string, IFilter> enabledFilters)
			: this(oneToManyPersister, batchSize, null, factory, enabledFilters)
		{
		}

		public OneToManyLoader(
			IQueryableCollection oneToManyPersister,
			int batchSize,
			SqlString subquery,
			ISessionFactoryImplementor factory,
			IDictionary<string, IFilter> enabledFilters)
			: base(oneToManyPersister, factory, enabledFilters)
		{
			JoinWalker walker = new OneToManyJoinWalker(
				oneToManyPersister,
				batchSize,
				subquery,
				factory,
				enabledFilters
				);
			InitFromWalker(walker);

			PostInstantiate();

			log.Debug("Static select for one-to-many " + oneToManyPersister.Role + ": " + SqlString);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?