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


C# IJoinable类代码示例

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


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

示例1: SelectFragment

 public override string SelectFragment(IJoinable rhs, string rhsAlias, string lhsAlias,
     string entitySuffix, string collectionSuffix, bool includeCollectionColumns)
 {
     // we need to determine the best way to know that two joinables
     // represent a single many-to-many...
     if (rhs != null && IsManyToMany && !rhs.IsCollection)
     {
         IAssociationType elementType = (IAssociationType) ElementType;
         if (rhs.Equals(elementType.GetAssociatedJoinable(Factory)))
         {
             return ManyToManySelectFragment(rhs, rhsAlias, lhsAlias, collectionSuffix);
         }
     }
     return includeCollectionColumns ? SelectFragment(lhsAlias, collectionSuffix) : string.Empty;
 }
开发者ID:zibler,项目名称:zibler,代码行数:15,代码来源:BasicCollectionPersister.cs

示例2: 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

示例3: SelectFragment

		public override string SelectFragment(IJoinable rhs, string rhsAlias, string lhsAlias, string entitySuffix, string collectionSuffix, bool includeCollectionColumns)
		{
			var buf = new StringBuilder();

			if (includeCollectionColumns)
			{
				buf.Append(SelectFragment(lhsAlias, collectionSuffix)).Append(StringHelper.CommaSpace);
			}

			var ojl = (IOuterJoinLoadable)ElementPersister;
			return buf.Append(ojl.SelectFragment(lhsAlias, entitySuffix)).ToString(); //use suffix for the entity columns
		}
开发者ID:mrhihi,项目名称:nhibernate-core,代码行数:12,代码来源:OneToManyPersister.cs

示例4: SelectFragment

		public abstract string SelectFragment(IJoinable rhs, string rhsAlias, string lhsAlias, string currentEntitySuffix,
		                                      string currentCollectionSuffix, bool includeCollectionColumns);
开发者ID:khaliyo,项目名称:Spring.net-NHibernate.net-Asp.net-MVC-DWZ-,代码行数:2,代码来源:AbstractCollectionPersister.cs

示例5: 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

示例6: 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

示例7: SetRoot

		public JoinSequence SetRoot(IJoinable joinable, string alias)
		{
			this.rootAlias = alias;
			this.rootJoinable = joinable;
			return this;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:6,代码来源:JoinSequence.cs

示例8: AddExtraJoins

		private void AddExtraJoins(JoinFragment joinFragment, string alias, IJoinable joinable, bool innerJoin)
		{
			bool include = IsIncluded(alias);
			joinFragment.AddJoins(joinable.FromJoinFragment(alias, innerJoin, include),
			                      joinable.WhereJoinFragment(alias, innerJoin, include));
		}
开发者ID:pallmall,项目名称:WCell,代码行数:6,代码来源:JoinSequence.cs

示例9: IsManyToManyRoot

		private bool IsManyToManyRoot(IJoinable joinable)
		{
			if (joinable != null && joinable.IsCollection)
			{
				IQueryableCollection persister = (IQueryableCollection) joinable;
				return persister.IsManyToMany;
			}
			return false;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:9,代码来源:JoinSequence.cs

示例10: ManyToManySelectFragment

		private string ManyToManySelectFragment(IJoinable rhs, string rhsAlias, string lhsAlias, string collectionSuffix)
		{
			SelectFragment frag = GenerateSelectFragment(lhsAlias, collectionSuffix);

			string[] _elementColumnNames = rhs.KeyColumnNames;
			frag.AddColumns(rhsAlias, _elementColumnNames, elementColumnAliases);
			AppendIndexColumns(frag, lhsAlias);
			AppendIdentifierColumns(frag, lhsAlias);

			return frag.ToSqlStringFragment(false);
		}
开发者ID:paulbatum,项目名称:nhibernate,代码行数:11,代码来源:BasicCollectionPersister.cs

示例11: 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

示例12: WalkAssociationTree

		/// <summary>
		///  Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary)
		/// </summary>
		/// <param name="type"></param>
		/// <param name="aliasedForeignKeyColumns"></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="joinType"></param>
		/// <param name="factory"></param>
		private void WalkAssociationTree(
			IAssociationType type,
			string[ ] aliasedForeignKeyColumns,
			IJoinable persister,
			string alias,
			IList associations,
			ISet visitedPersisters,
			string path,
			int currentDepth,
			JoinType joinType,
			ISessionFactoryImplementor factory )
		{
			IJoinable joinable = type.GetJoinable( factory );

			int maxFetchDepth = factory.MaximumFetchDepth;

			bool enabled = ( joinType == JoinType.InnerJoin ) || (
				( maxFetchDepth <= 0 || currentDepth < maxFetchDepth ) &&
				!visitedPersisters.Contains( joinable ) &&
				( !joinable.IsCollection || !ContainsCollectionPersister( associations ) )
				);

			if ( enabled )
			{
				visitedPersisters.Add( persister );
				OuterJoinableAssociation assoc = new OuterJoinableAssociation();
				associations.Add( assoc );

				// After adding to collection!!
				string subalias = GenerateTableAlias(
					joinable.Name,
					associations.Count,
					path,
					joinable.IsManyToMany );

				assoc.Joinable = joinable;
				assoc.TableName = joinable.TableName;
				assoc.PrimaryKeyColumns = type.GetReferencedColumns( factory );
				assoc.ForeignKeyColumns = aliasedForeignKeyColumns;
				assoc.Subalias = subalias;
				assoc.Owner = GetPosition( alias, associations );
				assoc.IsOneToOne = type.IsEntityType &&
					( (EntityType) type ).IsOneToOne &&
					!( (EntityType) type ).IsUniqueKeyReference;
				assoc.JoinType = joinType;

				if ( assoc.ForeignKeyColumns.Length != assoc.PrimaryKeyColumns.Length ||
					assoc.ForeignKeyColumns.Length == 0 )
				{
					throw new MappingException( string.Format( "Invalid join columns for association: {0}", path ) );
				}

				int nextDepth = currentDepth + 1;
				if ( !joinable.IsCollection )
				{
					if ( joinable is IOuterJoinLoadable )
					{
						WalkClassTree( (IOuterJoinLoadable) joinable, subalias, associations, visitedPersisters, path, nextDepth, factory );
					}
				}
				else
				{
					if ( joinable is IQueryableCollection )
					{
						WalkCollectionTree( (IQueryableCollection) joinable, subalias, associations, visitedPersisters, path, nextDepth, factory ) ;
					}
				}
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:82,代码来源:OuterJoinLoader.cs

示例13: SelectFragment

		public string SelectFragment(IJoinable rhs, string rhsAlias, string lhsAlias,
			string entitySuffix, string collectionSuffix, bool includeCollectionColumns)
		{
			return SelectFragment(lhsAlias, entitySuffix);
		}
开发者ID:rbirkby,项目名称:nhibernate-core,代码行数:5,代码来源:AbstractEntityPersister.cs

示例14: GenerateTableAlias

		protected virtual string GenerateTableAlias(int n, string path, IJoinable joinable)
		{
			return StringHelper.GenerateAlias(joinable.Name, n);
		}
开发者ID:rbirkby,项目名称:nhibernate-core,代码行数:4,代码来源:JoinWalker.cs

示例15: GetWhereJoinFragment

		private static SqlString GetWhereJoinFragment(IJoinable persister, string tableAlias)
		{
			SqlString whereJoinFragment = persister.WhereJoinFragment(tableAlias, true, false);
			if (whereJoinFragment == null)
			{
				whereJoinFragment = SqlString.Empty;
			}
			else
			{
				whereJoinFragment = whereJoinFragment.Trim();
				if (whereJoinFragment.StartsWithCaseInsensitive("and "))
				{
					whereJoinFragment = whereJoinFragment.Substring(4);
				}
			}
			return whereJoinFragment;
		}
开发者ID:thilaknathen,项目名称:nhibernate-core,代码行数:17,代码来源:AbstractStatementExecutor.cs


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