當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。