HasorDB 类型处理器
确定一个类型处理器的顺序如下:
- 1st
Java
+ Jdbc
- 2st
Java
- 3st
Jdbc
- 4st 使用
UnknownTypeHandler
类型处理器(交叉)
下面表格中 JAVA类型 和 JDBC 必须全部满足才能选择对应的
类型处理器
,也是第一优先级。
JDBC 类型 | Java 类型 | 类型处理器 |
---|---|---|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR , Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.time.MonthDay
|
MonthDayOfStringTypeHandler
|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR , Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.time.YearMonth
|
YearMonthOfStringTypeHandler
|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR , Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.time.Year
|
YearOfStringTypeHandler
|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR , Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.time.Month
|
MonthOfStringTypeHandler
|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR
|
java.lang.String
|
StringTypeHandler
|
Types.CHAR , Types.VARCHAR , Types.LONGVARCHAR
|
java.io.Reader
|
StringReaderTypeHandler
|
Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.lang.String
|
NStringTypeHandler
|
Types.NCHAR , Types.NVARCHAR , Types.LONGNVARCHAR
|
java.io.Reader
|
NStringReaderTypeHandler
|
Types.TINYINT , Types.SMALLINT , Types.INTEGER , Types.BIGINT , Types.FLOAT , Types.DOUBLE , Types.REAL , Types.NUMERIC , Types.DECIMAL
|
java.time.MonthDay
|
MonthDayOfNumberTypeHandler
|
Types.TINYINT , Types.SMALLINT , Types.INTEGER , Types.BIGINT , Types.FLOAT , Types.DOUBLE , Types.REAL , Types.NUMERIC , Types.DECIMAL
|
java.time.YearMonth
|
YearMonthOfNumberTypeHandler
|
Types.TINYINT , Types.SMALLINT , Types.INTEGER , Types.BIGINT , Types.FLOAT , Types.DOUBLE , Types.REAL , Types.NUMERIC , Types.DECIMAL
|
java.time.Year
|
YearOfNumberTypeHandler
|
Types.TINYINT , Types.SMALLINT , Types.INTEGER , Types.BIGINT , Types.FLOAT , Types.DOUBLE , Types.REAL , Types.NUMERIC , Types.DECIMAL
|
java.time.Month
|
MonthOfNumberTypeHandler
|
Types.CLOB
|
java.lang.String
|
ClobTypeHandler
|
Types.NCLOB
|
java.lang.String
|
NClobTypeHandler
|
Types.CLOB
|
java.io.Reader
|
ClobReaderTypeHandler
|
Types.NCLOB
|
java.io.Reader
|
NClobReaderTypeHandler
|
Types.SQLXML
|
java.lang.String
|
SqlXmlTypeHandler
|
Types.SQLXML
|
java.io.Reader
|
SqlXmlForReaderTypeHandler
|
Types.SQLXML
|
java.io.InputStream
|
SqlXmlForInputStreamTypeHandler
|
Types.BINARY , Types.VARBINARY , Types.LONGVARBINARY
|
byte[]
|
BytesTypeHandler
|
Types.BINARY , Types.VARBINARY , Types.LONGVARBINARY
|
java.lang.Byte[]
|
BytesForWrapTypeHandler
|
Types.BINARY , Types.VARBINARY , Types.LONGVARBINARY
|
java.io.InputStream
|
BytesInputStreamTypeHandler
|
Types.BLOB
|
byte[]
|
BlobBytesTypeHandler
|
Types.BINARY , Types.VARBINARY , Types.LONGVARBINARY , Types.BLOB
|
java.lang.Byte[]
|
BlobBytesForWrapTypeHandler
|
Types.BLOB
|
java.io.InputStream
|
BlobInputStreamTypeHandler
|
Types.ARRAY
|
java.lang.Object
|
ArrayTypeHandler
|
类型处理器
下面表格中 JAVA类型 和 JDBC 只需满足任意一个,即可激活对应的
类型处理器
JDBC 类型 | Java 类型 | 类型处理器 |
---|---|---|
Types.BIT , Types.BOOLEAN
|
java.lang.Boolean , boolean
|
BooleanTypeHandler
|
Types.TINYINT
|
java.lang.Byte , byte
|
ByteTypeHandler
|
Types.SMALLINT
|
java.lang.Short , short
|
ShortTypeHandler
|
Types.INTEGER
|
java.lang.Integer , int
|
IntegerTypeHandler
|
Types.BIGINT
|
java.lang.Long , long
|
LongTypeHandler
|
Types.FLOAT
|
java.lang.Float , float
|
FloatTypeHandler
|
Types.DOUBLE
|
java.lang.Double , double
|
DoubleTypeHandler
|
Types.CHAR
|
java.lang.Character , char
|
CharacterTypeHandler
|
Types.NCHAR
|
- | NCharacterTypeHandler
|
Types.TIMESTAMP
|
java.util.Date
|
DateTypeHandler
|
Types.DATE
|
- | DateOnlyTypeHandler
|
- | java.sql.Date
|
SqlDateTypeHandler
|
- | java.sql.Timestamp
|
SqlTimestampTypeHandler
|
- | java.sql.Time
|
SqlTimeTypeHandler
|
Types.TIME
|
- | TimeOnlyTypeHandler
|
- | java.time.Instant
|
InstantTypeHandler
|
- | java.time.chrono.JapaneseDate
|
JapaneseDateTypeHandler
|
- | java.time.Year
|
YearOfTimeTypeHandler
|
- | java.time.Month
|
MonthOfTimeTypeHandler
|
- | java.time.YearMonth
|
YearMonthOfTimeTypeHandler
|
- | java.time.MonthDay
|
MonthDayOfTimeTypeHandler
|
- | java.time.LocalDate
|
LocalDateTypeHandler
|
- | java.time.LocalTime
|
LocalTimeTypeHandler
|
- | java.time.LocalDateTime
|
LocalDateTimeTypeHandler
|
- | java.time.ZonedDateTime
|
ZonedDateTimeTypeHandler
|
- | java.time.OffsetDateTime
|
OffsetDateTimeForUTCTypeHandler
|
- | java.time.OffsetTime
|
OffsetTimeForUTCTypeHandler
|
Types.TIME_WITH_TIMEZONE
|
- | OffsetTimeForSqlTypeHandler
|
Types.TIMESTAMP_WITH_TIMEZONE
|
- | OffsetDateTimeForSqlTypeHandler
|
Types.VARCHAR , Types.LONGVARCHAR
|
java.lang.String
|
StringTypeHandler
|
Types.NVARCHAR , Types.LONGNVARCHAR
|
- | NStringTypeHandler
|
- | java.math.BigInteger
|
BigIntegerTypeHandler
|
Types.REAL , Types.NUMERIC , Types.DECIMAL
|
java.math.BigDecimal
|
BigDecimalTypeHandler
|
- | java.io.Reader
|
StringReaderTypeHandler
|
- | java.io.InputStream
|
BytesInputStreamTypeHandler
|
- | java.lang.Byte[]
|
BytesForWrapTypeHandler
|
Types.BINARY , Types.VARBINARY , Types.LONGVARBINARY
|
byte[]
|
BytesTypeHandler
|
- | java.lang.Number
|
NumberTypeHandler
|
Types.CLOB
|
java.sql.Clob
|
ClobTypeHandler
|
Types.NCLOB
|
java.sql.NClob
|
NClobTypeHandler
|
Types.BLOB
|
java.sql.Blob
|
BlobBytesTypeHandler
|
Types.OTHER
|
java.lang.Object
|
UnknownTypeHandler
|
Types.ARRAY
|
java.lang.Object[]
|
ArrayTypeHandler
|
Types.SQLXML
|
- | SqlXmlTypeHandler
|
Types.JAVA_OBJECT
|
- | ObjectTypeHandler
|