NHibernate hbm Mapping檔 property type 對照表

摘要:NHibernate hbm Mapping檔 property type 對照表

 

Mapping Type .NET Type  System.Data.DbType
 Int16  System.Int16  DbType.Int16
 Int32  System.Int32  DbType.Int32
 Int64  System.Int64  DbType.Int64
 Single  System.Single  DbType.Single
 Double  System.Double  DbType.Double
 Decimal  System.Decimal  DbType.Decimal
 Byte  System.Byte  DbType.Byte
 Char  System.Char  DbType.StringFixedLength - 1 character
 AnsiChar  System.Char  DbType.AnsiStringFixedLength - 1 character
 Boolean  System.Boolean  DbType.Boolean
 Guid  System.Guid  DbType.Guid
 PersistentEnum  System.Enum (an enumeration)  The DbType for the underlying value
 TrueFalse  System.Boolean  DbType.AnsiStringFixedLength - either 'T' or 'F'
 YesNo  System.Boolean  DbType.AnsiStringFixedLength - either 'Y' or 'N'
 DateTime          System.DateTime                       DbType.DateTime - ignores the milliseconds
 Ticks          System.DateTime                       DbType.Int64
 TimeSpan          System.TimeSpan                       DbType.Int64
 Timestamp          System.DateTime                       DbType.DateTime - as specific as database supports
 String           System.String                              DbType.String
 AnsiString           System.String                              DbType.AnsiString
 Binary          System.Byte[]  DbType.Binary
 BinaryBlob          System.Byte[]  DbType.Binary
 StringBlob          System.String  DbType.String
 Serializable          Any System.Object marked with SerializableAttribute  DbType.Binary