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


C# IAbstractComponentType.EnableJoinedFetch方法代码示例

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


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

示例1: WalkCompositeElementTree

		/// <summary>
		/// For a composite element, add to a list of associations to be fetched by outerjoin
		/// </summary>
		/// <param name="compositeType"></param>
		/// <param name="cols"></param>
		/// <param name="persister"></param>
		/// <param name="alias"></param>
		/// <param name="associations"></param>
		/// <param name="visitedPersisters"></param>
		/// <param name="path"></param>
		/// <param name="currentDepth"></param>
		/// <param name="factory"></param>
		private void WalkCompositeElementTree(
			IAbstractComponentType compositeType,
			string[ ] cols,
			IQueryableCollection persister,
			string alias,
			IList associations,
			ISet visitedPersisters,
			string path,
			int currentDepth,
			ISessionFactoryImplementor factory )
		{
			IType[ ] types = compositeType.Subtypes;
			string[ ] propertyNames = compositeType.PropertyNames;
			int begin = 0;
			for( int i = 0; i < types.Length; i++ )
			{
				int length = types[ i ].GetColumnSpan( factory );
				string[ ] range = ArrayHelper.Slice( cols, begin, length );

				if( types[ i ].IsAssociationType )
				{
					IAssociationType associationType = types[ i ] as IAssociationType;

					// simple, because we can't have a one-to-one or collection in a composite element:
					string[] aliasedForeignKeyColumns = StringHelper.Qualify( alias, range );
					string subpath = SubPath( path, propertyNames[ i ] );
					JoinType joinType = GetJoinType(
						associationType,
						compositeType.EnableJoinedFetch( i ),
						subpath,
						persister.TableName,
						range,
						factory
						);

					if ( joinType != JoinType.None )
					{
						WalkAssociationTree( 
							associationType, 
							aliasedForeignKeyColumns, 
							persister, 
							alias, 
							associations, 
							visitedPersisters, 
							subpath, 
							currentDepth,
							joinType,
							factory
							);
					}
				}
				else if( types[ i ].IsComponentType )
				{
					string subpath = SubPath( path, propertyNames[ i ] );
					WalkCompositeElementTree(
						( IAbstractComponentType ) types[ i ],
						range,
						persister,
						alias,
						associations,
						visitedPersisters,
						subpath,
						currentDepth,
						factory
						);

				}
				begin += length;
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:82,代码来源:OuterJoinLoader.cs

示例2: WalkComponentTree

		/// <summary>
		/// For a component, add to a list of associations to be fetched by outerjoin
		/// </summary>
		/// <param name="componentType"></param>
		/// <param name="propertyNumber"></param>
		/// <param name="cols"></param>
		/// <param name="persister"></param>
		/// <param name="alias"></param>
		/// <param name="associations"></param>
		/// <param name="visitedPersisters"></param>
		/// <param name="aliasedCols"></param>
		/// <param name="path"></param>
		/// <param name="currentDepth"></param>
		/// <param name="factory"></param>
		private void WalkComponentTree(
			IAbstractComponentType componentType,
			int propertyNumber,
			string[ ] cols,
			string[ ] aliasedCols,
			IOuterJoinLoadable persister,
			string alias,
			IList associations,
			ISet visitedPersisters,
			string path,
			int currentDepth,
			ISessionFactoryImplementor factory )
		{
			IType[ ] types = componentType.Subtypes;
			string[ ] propertyNames = componentType.PropertyNames;
			int begin = 0;
			for( int i = 0; i < types.Length; i++ )
			{
				int length = types[ i ].GetColumnSpan( factory );
				string[ ] range = ArrayHelper.Slice( cols, begin, length );
				string[ ] aliasedRange = ArrayHelper.Slice( aliasedCols, begin, length );

				if( types[ i ].IsAssociationType )
				{
					IAssociationType associationType = ( IAssociationType ) types[ i ];

					if ( IsJoinedFetchAlwaysDisabled( persister, associationType, propertyNumber ) )
					{
						return;
					}

					string[] aliasedFkColumns = GetAliasedForeignKeyColumns( persister, alias, associationType, aliasedRange );
					string[] fkColumns = GetForeignKeyColumns( persister, associationType, range );
					string subpath = SubPath( path, propertyNames[ i ] );
					JoinType joinType = GetJoinType(
						associationType,
						componentType.EnableJoinedFetch( i ),
						subpath,
						persister.GetSubclassPropertyTableName( propertyNumber ),
						fkColumns,
						factory
						);

					if ( joinType != JoinType.None )
					{
						WalkAssociationTree(
							associationType,
							aliasedFkColumns,
							persister,
							alias,
							associations,
							visitedPersisters,
							subpath,
							currentDepth,
							joinType,
							factory
							);
					}
				}
				else if( types[ i ].IsComponentType )
				{
					string subpath = SubPath( path, propertyNames[ i ] );

					WalkComponentTree( 
						( IAbstractComponentType ) types[ i ], 
						propertyNumber, 
						range, 
						aliasedRange, 
						persister, 
						alias, 
						associations, 
						visitedPersisters, 
						subpath, 
						currentDepth,
						factory
						);
				}
				begin += length;
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:94,代码来源:OuterJoinLoader.cs


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