本文整理匯總了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));
}
示例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));
}
示例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);
}
示例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;
}
示例5: YesNoSqlType
public void YesNoSqlType()
{
Column column = new Column(NHibernateUtil.YesNo, 0);
string type = column.GetSqlType(_dialect, null);
Assert.AreEqual("CHAR(1)", type);
}