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


C# IType.GetColumnSpan方法代码示例

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


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

示例1: MutateRowValueConstructorSyntaxesIfNecessary

		protected void MutateRowValueConstructorSyntaxesIfNecessary(IType lhsType, IType rhsType)
		{
			// TODO : this really needs to be delayed unitl after we definitively know all node types
			// where this is currently a problem is parameters for which where we cannot unequivocally
			// resolve an expected type
			ISessionFactoryImplementor sessionFactory = SessionFactoryHelper.Factory;

			if (lhsType != null && rhsType != null)
			{
				int lhsColumnSpan = lhsType.GetColumnSpan(sessionFactory);
				var rhsColumnSpan = rhsType.GetColumnSpan(sessionFactory);
				// NH different behavior NH-1801
				if (lhsColumnSpan != rhsColumnSpan && !AreCompatibleEntityTypes(lhsType, rhsType))
				{
					throw new TypeMismatchException("left and right hand sides of a binary logic operator were incompatibile ["
					                                + lhsType.Name + " : " + rhsType.Name + "]");
				}
				if (lhsColumnSpan > 1)
				{
					// for dialects which are known to not support ANSI-SQL row-value-constructor syntax,
					// we should mutate the tree.
					if (!sessionFactory.Dialect.SupportsRowValueConstructorSyntax)
					{
						MutateRowValueConstructorSyntax(lhsColumnSpan);
					}
				}
			}
		}
开发者ID:Mrding,项目名称:Ribbon,代码行数:28,代码来源:BinaryLogicOperatorNode.cs

示例2: InitPropertyPaths

		protected internal void InitPropertyPaths( string path, IType type, string[] columns, string[] formulaTemplates, IMapping factory )
		{
			if (columns.Length != type.GetColumnSpan(factory))
			{
				throw new MappingException(
					string.Format("broken column mapping for: {0} of: {1}, type {2} expects {3} columns, but {4} were mapped",
								  path, EntityName, type.Name, type.GetColumnSpan(factory), columns.Length));
			}

			if (type.IsAssociationType)
			{
				var actType = (IAssociationType)type;
				if (actType.UseLHSPrimaryKey)
				{
					columns = IdentifierColumnNames;
				}
				else
				{
					string foreignKeyProperty = actType.LHSPropertyName;
					if (foreignKeyProperty != null)
					{
						//TODO: this requires that the collection is defined after the
						//      referenced property in the mapping file (ok?)
						if (!columnsByPropertyPath.TryGetValue(foreignKeyProperty, out columns))
							return; //get em on the second pass!
					}
				}
			}

			if (path != null)
			{
				AddPropertyPath(path, type, columns, formulaTemplates);
			}

			if (type.IsComponentType)
			{
				var actype = (IAbstractComponentType)type;
				InitComponentPropertyPaths(path, actype, columns, formulaTemplates, factory);
				if (actype.IsEmbedded)
				{
					InitComponentPropertyPaths(path == null ? null : StringHelper.Qualifier(path), actype, columns, formulaTemplates, factory);
				}
			}
			else if (type.IsEntityType)
			{
				InitIdentifierPropertyPaths(path, (EntityType) type, columns, factory);
			}
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:48,代码来源:AbstractPropertyMapping.cs

示例3: InitPropertyPaths

		/// <summary>
		/// 
		/// </summary>
		/// <param name="path"></param>
		/// <param name="type"></param>
		/// <param name="columns"></param>
		/// <param name="factory"></param>
		protected void InitPropertyPaths( string path, IType type, string[] columns, ISessionFactoryImplementor factory )
		{
			if(columns.Length != type.GetColumnSpan( factory ) )
			{
				throw new MappingException(
					string.Format( "broken column mapping for: {0} of: {1}, type {2} expects {3} columns, but {4} were mapped",
					path, ClassName, type.Name, type.GetColumnSpan( factory ), columns.Length ) );
			}

			if( type.IsAssociationType && ((IAssociationType) type).UsePrimaryKeyAsForeignKey )
			{
				columns = IdentifierColumnNames;
			}

			if( path!=null )
			{
				AddPropertyPath( path, type, columns );
			}

			if( type.IsComponentType )
			{
				InitComponentPropertyPaths( path, (IAbstractComponentType) type, columns, factory );
			}
			else if( type.IsEntityType )
			{
				InitIdentifierPropertyPaths( path, (EntityType) type, columns, factory );
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:35,代码来源:AbstractPropertyMapping.cs


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