NHibernate type,. NET type, database field type mapping relationship
Because the NHibernate type and C # data types are corresponding, they are also categorized as value types and reference types, and there are several special classes that we describe separately:
--Value type | What you should know is that value types are inherited from System.ValueType
| NHibernate type |
. NET Types |
database field type |
Note |
| Ansichar or Char |
Char |
CHAR (n) |
|
| Boolean |
Boolean |
Boolean |
|
| Byte |
Byte |
Byte |
|
| Date |
Datetime |
Date |
Declaration type= "Date" must be displayed |
| Datetime |
Datetime |
Datetime |
Database fields Ignore milliseconds |
| DateTime2 |
Datetime |
DateTime2 |
Declaration type= "DateTime2" must be displayed |
| Decimal |
Decimal |
Decimal |
|
| Double |
Double |
Double |
|
| Guid |
Guid |
Guid |
|
| Int16 |
Int16 |
Int16 |
|
| Int32 |
Int32 |
Int32 |
|
| Int64 |
Int64 |
Int64 |
|
| Single |
Single |
Single |
|
| Ticks |
Datetime |
Int64 |
The specified type= "Ticks" must be displayed |
| Time |
Datetime |
Time |
The specified type= "time" must be displayed |
| Timeastimespan |
TimeSpan |
Time |
The specified type= "Timeastimespan" must be displayed |
| TimeSpan |
TimeSpan |
Int64 |
|
| TrueFalse or Yesno |
Boolean |
char (1) t/f or y/n |
The specified type= "TrueFalse" or type= "YesNo" must be displayed |
Some of the less common are not listed, taking into account the limited support of some database issues, the increase in distress, or not listed.
--Reference type | What you should know is that value types are inherited from System.Object
| NHibernate type |
. NET Types |
database field type |
Describe |
| Binary |
Byte[] |
Binary |
|
| String |
String |
String |
|
--A few special types
| NHibernate |
. NET Types |
database field type |
Describe |
| Binaryblob |
Byte[] |
Binary |
|
| Stringclob |
String |
String |
|
Type in the second part NHibernate