<commit_before>using System.Collections.Generic;
using NHibernate.Engine;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Type;
using NHibernate.Util;

namespace NHibernate.Loader.Entity
{
	/// <summary>
	/// A walker for loaders that fetch entities
	/// </summary>
	public class EntityJoinWalker : AbstractEntityJoinWalker
	{
		private readonly LockMode lockMode;

		public EntityJoinWalker(IOuterJoinLoadable persister, string[] uniqueKey, int batchSize,
			LockMode lockMode, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(persister, factory, enabledFilters)
		{
			this.lockMode = lockMode;

			SqlStringBuilder whereCondition = WhereString(Alias, uniqueKey, batchSize)
				//include the discriminator and class-level where, but not filters
				.Add(persister.FilterFragment(Alias, new CollectionHelper.EmptyMapClass<string, IFilter>()));

			InitAll(whereCondition.ToSqlString(), string.Empty, lockMode);
		}

		/// <summary>
		/// Disable outer join fetching if this loader obtains an
		/// upgrade lock mode
		/// </summary>
		protected override bool IsJoinedFetchEnabled(IAssociationType type, FetchMode config,
		                                             CascadeStyle cascadeStyle)
		{
			return lockMode.GreaterThan(LockMode.Read) ?
			       false :
			       base.IsJoinedFetchEnabled(type, config, cascadeStyle);
		}

		public override string Comment
		{
			get { return "load " + Persister.ClassName; }
		}
	}
}<commit_msg>Minor<commit_after>using System.Collections.Generic;
using NHibernate.Engine;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Type;
using NHibernate.Util;

namespace NHibernate.Loader.Entity
{
	/// <summary>
	/// A walker for loaders that fetch entities
	/// </summary>
	public class EntityJoinWalker : AbstractEntityJoinWalker
	{
		private readonly LockMode lockMode;

		public EntityJoinWalker(IOuterJoinLoadable persister, string[] uniqueKey, int batchSize,
			LockMode lockMode, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
			: base(persister, factory, enabledFilters)
		{
			this.lockMode = lockMode;

			SqlStringBuilder whereCondition = WhereString(Alias, uniqueKey, batchSize)
				//include the discriminator and class-level where, but not filters
				.Add(persister.FilterFragment(Alias, new CollectionHelper.EmptyMapClass<string, IFilter>()));

			InitAll(whereCondition.ToSqlString(), string.Empty, lockMode);
		}

		/// <summary>
		/// Disable outer join fetching if this loader obtains an
		/// upgrade lock mode
		/// </summary>
		protected override bool IsJoinedFetchEnabled(IAssociationType type, FetchMode config,
		                                             CascadeStyle cascadeStyle)
		{
			return lockMode.GreaterThan(LockMode.Read) ?
			       false :
			       base.IsJoinedFetchEnabled(type, config, cascadeStyle);
		}

		public override string Comment
		{
			get { return "load " + Persister.EntityName; }
		}
	}
}
{'fraction_non_alphanumeric': 0.09051866534522629, 'fraction_numerical': 0.0, 'mean_word_length': 3.7835703001579777, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1209050', 'n_tokens_mistral': 955, 'n_tokens_neox': 825, 'n_words': 216}