当前位置: 首页>>代码示例>>C#>>正文


C# IJoinable.ConsumesEntityAlias方法代码示例

本文整理汇总了C#中IJoinable.ConsumesEntityAlias方法的典型用法代码示例。如果您正苦于以下问题:C# IJoinable.ConsumesEntityAlias方法的具体用法?C# IJoinable.ConsumesEntityAlias怎么用?C# IJoinable.ConsumesEntityAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IJoinable的用法示例。


在下文中一共展示了IJoinable.ConsumesEntityAlias方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateTableAlias

 protected override string GenerateTableAlias(int n, string path, IJoinable joinable)
 {
     if (joinable.ConsumesEntityAlias())
     {
         ICriteria subcriteria = translator.GetCriteria(path);
         String sqlAlias = subcriteria == null ? null : translator.GetSQLAlias(subcriteria);
         if (sqlAlias != null)
         {
             userAliasList.Add(subcriteria.Alias); //alias may be null
             return sqlAlias; //EARLY EXIT
         }
         else
         {
             userAliasList.Add(null);
         }
     }
     return base.GenerateTableAlias(n + translator.SQLAliasCount, path, joinable);
 }
开发者ID:zibler,项目名称:zibler,代码行数:18,代码来源:CriteriaJoinWalker.cs

示例2: GenerateTableAlias

		protected override string GenerateTableAlias(int n, string path, IJoinable joinable)
		{
			// TODO: deal with side-effects (changes to includeInSelectList, userAliasList, resultTypeList)!!!
			bool shouldCreateUserAlias = joinable.ConsumesEntityAlias(); 
			if(shouldCreateUserAlias == false  && joinable.IsCollection)
			{
				var elementType = ((ICollectionPersister)joinable).ElementType;
				if (elementType != null)
					shouldCreateUserAlias = elementType.IsComponentType;
			}
			if (shouldCreateUserAlias)
			{
				ICriteria subcriteria = translator.GetCriteria(path);
				string sqlAlias = subcriteria == null ? null : translator.GetSQLAlias(subcriteria);
				if (sqlAlias != null)
				{
					if (!translator.HasProjection)
					{
						includeInResultRowList.Add(subcriteria.Alias != null);
						if (subcriteria.Alias!=null)
						{
							userAliasList.Add(subcriteria.Alias); //alias may be null
							resultTypeList.Add(translator.ResultType(subcriteria));
						}
					}
					return sqlAlias; //EARLY EXIT
				}
				else
				{
					if (!translator.HasProjection)
						includeInResultRowList.Add(false);
				}
			}
			return base.GenerateTableAlias(n + translator.SQLAliasCount, path, joinable);
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:35,代码来源:CriteriaJoinWalker.cs

示例3: GenerateTableAlias

		protected override string GenerateTableAlias(int n, string path, IJoinable joinable)
		{
			bool shouldCreateUserAlias = joinable.ConsumesEntityAlias(); 
			if(shouldCreateUserAlias == false  && joinable.IsCollection)
			{
				var elementType = ((ICollectionPersister)joinable).ElementType;
				if (elementType != null)
					shouldCreateUserAlias = elementType.IsComponentType;
			}
			if (shouldCreateUserAlias)
			{
				ICriteria subcriteria = translator.GetCriteria(path);
				string sqlAlias = subcriteria == null ? null : translator.GetSQLAlias(subcriteria);
				if (sqlAlias != null)
				{
					userAliasList.Add(subcriteria.Alias); //alias may be null
					return sqlAlias; //EARLY EXIT
				}

				userAliasList.Add(null);
			}
			return base.GenerateTableAlias(n + translator.SQLAliasCount, path, joinable);
		}
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:23,代码来源:CriteriaJoinWalker.cs

示例4: GenerateTableAlias

		protected override string GenerateTableAlias(int n, string path, IJoinable joinable)
		{
			// TODO: deal with side-effects (changes to includeInSelectList, userAliasList, resultTypeList)!!!

			// for collection-of-entity, we are called twice for given "path"
			// once for the collection Joinable, once for the entity Joinable.
			// the second call will/must "consume" the alias + perform side effects according to consumesEntityAlias()
			// for collection-of-other, however, there is only one call 
			// it must "consume" the alias + perform side effects, despite what consumeEntityAlias() return says
			// 
			// note: the logic for adding to the userAliasList is still strictly based on consumesEntityAlias return value

			bool shouldCreateUserAlias = joinable.ConsumesEntityAlias();
			if (!shouldCreateUserAlias && joinable.IsCollection)
			{
				// is it a collection-of-other (component or value) ?
				var elementType = ((ICollectionPersister) joinable).ElementType;
				if (elementType != null)
					shouldCreateUserAlias = elementType.IsComponentType || !elementType.IsEntityType;
			}

			string sqlAlias = null;

			if (shouldCreateUserAlias)
			{
				ICriteria subcriteria = translator.GetCriteria(path);
				sqlAlias = subcriteria == null ? null : translator.GetSQLAlias(subcriteria);

				if (joinable.ConsumesEntityAlias() && !translator.HasProjection)
				{
					includeInResultRowList.Add(subcriteria != null && subcriteria.Alias != null);

					if (sqlAlias != null)
					{
						if (subcriteria.Alias != null)
						{
							userAliasList.Add(subcriteria.Alias); //alias may be null
							resultTypeList.Add(translator.ResultType(subcriteria));
						}
					}
				}
			}

			if (sqlAlias == null)
				sqlAlias = base.GenerateTableAlias(n + translator.SQLAliasCount, path, joinable);

			return sqlAlias;
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:48,代码来源:CriteriaJoinWalker.cs


注:本文中的IJoinable.ConsumesEntityAlias方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。