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


C# Column.GetSqlType方法代码示例

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


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

示例1: StringSqlType

		public void StringSqlType()
		{
			Column column = new Column(NHibernateUtil.String, 0);
			Assert.AreEqual("NVARCHAR(255)", column.GetSqlType(_dialect, null));

			column.Length = 100;
			Assert.AreEqual("NVARCHAR(100)", column.GetSqlType(_dialect, null));

		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:9,代码来源:ColumnFixture.cs

示例2: StringSqlType

		public void StringSqlType()
		{
			SimpleValue sv = new SimpleValue();
			sv.TypeName = NHibernateUtil.String.Name;
			Column column = new Column();
			column.Value = sv;
			Assert.AreEqual("NVARCHAR(255)", column.GetSqlType(_dialect, null));

			column.Length = 100;
			Assert.AreEqual("NVARCHAR(100)", column.GetSqlType(_dialect, null));
		}
开发者ID:tkellogg,项目名称:NHibernate3-withProxyHooks,代码行数:11,代码来源:ColumnFixture.cs

示例3: YesNoSqlType

		public void YesNoSqlType()
		{
			SimpleValue sv = new SimpleValue();
			sv.TypeName = NHibernateUtil.YesNo.Name;
			Column column = new Column();
			column.Value = sv;
			string type = column.GetSqlType(_dialect, null);
			Assert.AreEqual("CHAR(1)", type);
		}
开发者ID:tkellogg,项目名称:NHibernate3-withProxyHooks,代码行数:9,代码来源:ColumnFixture.cs

示例4: ColumnInfo

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="column"></param>
		/// <param name="config"></param>
		/// <param name="dialect"></param>
		internal ColumnInfo(Column column, Configuration config, Dialect dialect)
		{
			_name = column.Name;
			_nullable = column.IsNullable;
			_sqlType = column.GetSqlType(dialect, new Mapping(config));

            //as of NH2.0, the length column seems to be set at 255 for non-string-like columns, which makes no sense
            //therefore ignore NH length for non-string like columns, and use -1 which corresponds to the pre-2.0 behaviour
            _length = (this.SqlType.IndexOf("char", System.StringComparison.InvariantCultureIgnoreCase) > -1) ? column.Length : -1;
        }
开发者ID:nhannd,项目名称:Xian,代码行数:16,代码来源:ColumnInfo.cs

示例5: YesNoSqlType

		public void YesNoSqlType()
		{
			Column column = new Column(NHibernateUtil.YesNo, 0);
			string type = column.GetSqlType(_dialect, null);
			Assert.AreEqual("CHAR(1)", type);
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:6,代码来源:ColumnFixture.cs


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