据类型对照表
.NET类型 |
Oracle类型 |
(必须在映射中指定用粗体表示) |
TypeHandler (自定义用粗体表示) |
Byte |
NUMBER(3) |
Byte |
ByteTypeHandler NullableByteTypeHandler |
SByte |
NUMBER(3) |
Byte或Int16(根据数值范围) |
SByteTypeHandler NullableSByteTypeHandler |
Int16 |
NUMBER(5) |
Int16 |
Int16TypeHandler NullableInt16TypeHandler |
UInt16 |
NUMBER(5) |
Int16或Int32(根据数值范围) |
UInt16TypeHandler NullableUInt16TypeHandler |
Int32 |
NUMBER(10) |
Int32 |
Int32TypeHandler NullableInt32TypeHandler |
UInt32 |
NUMBER(10) |
Int32或Int64(根据数值范围) |
UInt32TypeHandler NullableUInt32TypeHandler |
Int64 |
NUMBER(20) |
Int64 |
Int64TypeHandler NullableInt64TypeHandler |
UInt64 |
NUMBER(20) |
Int64或Decimal(根据数值范围) |
UInt64TypeHandler NullableUInt64TypeHandler |
Single |
FLOAT(24) |
Single |
SingleTypeHandler NullableSingleTypeHandler |
Single |
BINARY_SINGLE |
BinaryFloat |
|
Double |
DOUBLE PRECISION |
Double |
DoubleTypeHandler NullableDoubleTypeHandler |
Double |
BINARY_DOUBLE |
BinaryDouble |
|
Decimal |
NUMBER |
Decimal |
DecimalTypeHandler NullableDecimalTypeHandler |
Char |
VARCHAR2(1 Char) NVARCHAR2(1) |
Char NChar |
CharTypeHandler NullableCharTypeHandler |
String |
VARCHAR2(n char) NVARCHAR2(n) CLOB NCLOB |
Varchar2 NVarchar2 Clob NClob |
StringTypeHandler |
DateTime |
DATE TIMESTAMP TIMESTAMP WITH LOCAL TIME ZONE |
Date TimeStamp TimeStampLTZ |
DateTimeTypeHandler NullableDateTimeTypeHandler |
DateTimeOffset |
TIMESTAMP WITH TIME ZONE |
TimeStampTZ |
DateTimeOffsetTypeHandler NullableDateTimeOffsetTypeHandler |
TimeSpan |
INTERVAL DAY TO SECOND |
IntervalDS |
TimeSpanTypeHandler NullableTimeSpanTypeHandler |
Byte[] |
RAW BLOB |
Raw Blob |
ByteArrayTypeHandler |
Boolean |
NUMBER(1)(1/0) 或INTEGER(便于扩展) |
Int32 |
OneZeroBooleanTypeHandler NullableOneZeroBooleanTypeHandler |
Boolean |
VARCHAR2(1)( T / F ) |
Varchar2 |
TrueFalseBooleanTypeHandlerCallback NullableTrueFalseBooleanTypeHandlerCallback |
Boolean |
VARCHAR2(1)( Y / N ) |
Varchar2 |
YesNoBooleanTypeHandlerCallback NullableYesNoBooleanTypeHandlerCallback |
枚举类型 |
NUMBER(n)(存储基础类型的值) 或INTEGER(便于扩展) |
Byte/Int16/Int32/Int64 |
EnumTypeHandler |
枚举类型 |
VARCHAR2(n char)或NVARCHAR2(n)(存储常量名称) |
Varchar2/Nvarchar2 |
|
可序列化类型 |
BLOB |
Blob |
SerializableTypeHandlerCallBack |
Guid |
Varchar2(38)(ToString()方法) |
Varchar2 |
GuidTypeHandler NullableGuidTypeHandler |
XmlDocument |
NCLOB/CLOB(Save到TextWriter) |
NClob/Clob |
XmlDocumentTypeHandler |
XmlDocument |
BLOB(Save到Strema) |
Blob |