本文整理汇总了C#中Dialect.GetTypeName方法的典型用法代码示例。如果您正苦于以下问题:C# Dialect.GetTypeName方法的具体用法?C# Dialect.GetTypeName怎么用?C# Dialect.GetTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialect
的用法示例。
在下文中一共展示了Dialect.GetTypeName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SqlCreateStrings
public virtual string[] SqlCreateStrings(Dialect.Dialect dialect)
{
return new String[]
{
"create table " + tableName + " ( " + valueColumnName + " " + dialect.GetTypeName(SqlTypeFactory.Int64)
+ " )", "insert into " + tableName + " values ( " + initialValue + " )"
};
}
示例2: SqlCreateStrings
public virtual string[] SqlCreateStrings(Dialect.Dialect dialect)
{
string createString = dialect.CreateTableString + " " + TableName
+ " ( "
+ SegmentColumnName + " " + dialect.GetTypeName(SqlTypes.SqlTypeFactory.GetAnsiString(SegmentValueLength)) + " not null, "
+ ValueColumnName + " " + dialect.GetTypeName(SqlTypes.SqlTypeFactory.Int64) + ", "
+ dialect.PrimaryKeyString + " ( " + SegmentColumnName + ") "
+ ")";
return new string[] { createString };
}
示例3: GetSqlType
/// <summary>
/// Gets the SQL type of this column.
/// Returned type will be the SqlType, or be looked up by the Type property if SqlType is not set.
/// </summary>
public String GetSqlType(Dialect dialect)
{
return SqlType == null ? dialect.GetTypeName(DbType, Length, Precision, Scale) : SqlType;
}
示例4: GetDialectTypeName
private string GetDialectTypeName(Dialect.Dialect dialect, IMapping mapping)
{
if (IsCaracteristicsDefined())
{
// NH-1070 (the size should be 0 if the precision is defined)
return dialect.GetTypeName(GetSqlTypeCode(mapping), (!IsPrecisionDefined()) ? Length:0, Precision, Scale);
}
else
return dialect.GetTypeName(GetSqlTypeCode(mapping));
}
示例5: GetSqlType
/// <summary>
/// Gets the name of the data type for the column.
/// </summary>
/// <param name="dialect">The <see cref="Dialect.Dialect"/> to use to get the valid data types.</param>
/// <param name="mapping"></param>
/// <returns>
/// The name of the data type for the column.
/// </returns>
/// <remarks>
/// If the mapping file contains a value of the attribute <c>sql-type</c> this will
/// return the string contained in that attribute. Otherwise it will use the
/// typename from the <see cref="Dialect.Dialect"/> of the <see cref="SqlType"/> object.
/// </remarks>
public string GetSqlType(Dialect.Dialect dialect, IMapping mapping)
{
if (sqlType == null)
{
SqlType sqlTypeObject = GetAutoSqlType(mapping);
if (Length != DefaultPropertyLength)
{
return dialect.GetTypeName(sqlTypeObject, Length);
}
else
{
return dialect.GetTypeName(sqlTypeObject);
}
}
else
{
return sqlType;
}
}
示例6: SqlCreateStrings
/// <summary>
/// The SQL required to create the database objects for a TableGenerator.
/// </summary>
/// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with creating the sql.</param>
/// <returns>
/// An array of <see cref="String"/> objects that contain the Dialect specific sql to
/// create the necessary database objects and to create the first value as <c>1</c>
/// for the TableGenerator.
/// </returns>
public string[ ] SqlCreateStrings( Dialect.Dialect dialect )
{
// changed the first value to be "1" by default since an uninitialized Int32 is 0 - leaving
// it at 0 would cause problems with an unsaved-value="0" which is what most people are
// defaulting <id>'s with Int32 types at.
return new string[ ]
{
"create table " + tableName + " ( " + columnName + " " + dialect.GetTypeName( SqlTypeFactory.GetInt32() ) + " )",
"insert into " + tableName + " values ( 1 )"
};
}
示例7: GetDialectTypeName
private string GetDialectTypeName(Dialect.Dialect dialect, IMapping mapping)
{
if (IsCaracteristicsDefined())
return dialect.GetTypeName(GetSqlTypeCode(mapping), Length, Precision, Scale);
else
return dialect.GetTypeName(GetSqlTypeCode(mapping));
}