本文整理汇总了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);
}