hibernate tools 中 jdbc-type 与 hibernate-type 对照表

Hibernate映射类型 java类型 标准SQL类型

integer             java.lang.Integer                       INTEGER
long                java.lang.Long                          BIGINT
short               java.lang.Short                         SMALLINT
float               java.lang.Float                         FLOAT
double              java.lang.Float                         DOUBLE
big_decimal         java.math.BigDecimal                    NUMERIC
character           java.lang.String                        CHAR(1)
string              java.lang.String                        VARCHAR
byte                byte或java.lang.Byte                     TINYINT
boolean             boolean或java.lang.Boolean               BIT
yes_no              boolean或java.lang.Boolean               char(1)('Y'/'N')
true_false          boolean或java.lang.Boolean               char(1)('Y'/'N')
date                java.util.Date或java.sql.Date            DATE
time                java.util.Date或java.sql.Time            time
timestamp           java.util.Date或java.sql.timestamp       TIMESTAMP
calendar            java.util.Calendar                      TIMESTAMP
calendar_date       java.util.Calendar                      date
binary              byte[]                                  varbinary或blob
text                java.lang.String                        clob
serializable        java.io.Serializable实例                  varbinary或blob
clob                java.sql.Clob                           clob
blob                java.sql.Blob                           varbinary或blob
class               java.lang.Class                         varchar
locale              java.util.Locale                        varchar
timezone            java.util.TimeZone                      varchar
currency            java.util.Currency                      varchar

Hibernate的TypeFactory的类型内置配置打印如下:

1: Java.util.TimeZone---------------------org.hibernate.type.TimeZoneType
2: [Ljava.lang.Byte;---------------------org.hibernate.type.WrapperBinaryType
3: char---------------------org.hibernate.type.CharacterType
4: java.lang.Boolean---------------------org.hibernate.type.BooleanType
5: java.lang.Long---------------------org.hibernate.type.LongType
6: java.sql.Timestamp---------------------org.hibernate.type.TimestampType
7: long---------------------org.hibernate.type.LongType
8: java.lang.Float---------------------org.hibernate.type.FloatType
9: float---------------------org.hibernate.type.FloatType
10: timezone---------------------org.hibernate.type.TimeZoneType
11: time---------------------org.hibernate.type.TimeType
12: imm_serializable---------------------org.hibernate.type.AdaptedImmutableType
13: java.math.BigInteger---------------------org.hibernate.type.BigIntegerType
14: java.lang.Double---------------------org.hibernate.type.DoubleType
15: byte---------------------org.hibernate.type.ByteType
16: java.util.Locale---------------------org.hibernate.type.LocaleType
17: java.lang.Class---------------------org.hibernate.type.ClassType
18: java.sql.Time---------------------org.hibernate.type.TimeType
19: boolean---------------------org.hibernate.type.BooleanType
20: java.io.Serializable---------------------org.hibernate.type.SerializableType
21: text---------------------org.hibernate.type.TextType
22: java.lang.Object---------------------org.hibernate.type.AnyType
23: int---------------------org.hibernate.type.IntegerType
24: imm_binary---------------------org.hibernate.type.AdaptedImmutableType
25: class---------------------org.hibernate.type.ClassType
26: image---------------------org.hibernate.type.ImageType
27: java.lang.Integer---------------------org.hibernate.type.IntegerType
28: dbtimestamp---------------------org.hibernate.type.DbTimestampType
29: java.lang.Short---------------------org.hibernate.type.ShortType
30: imm_calendar_date---------------------org.hibernate.type.AdaptedImmutableType
31: java.sql.Blob---------------------org.hibernate.type.BlobType
32: double---------------------org.hibernate.type.DoubleType
33: java.sql.Date---------------------org.hibernate.type.DateType
34: big_integer---------------------org.hibernate.type.BigIntegerType
35: java.lang.Byte---------------------org.hibernate.type.ByteType
36: materialized_clob---------------------org.hibernate.type.MaterializedClobType
37: yes_no---------------------org.hibernate.type.YesNoType
38: char[]---------------------org.hibernate.type.CharArrayType
39: imm_dbtimestamp---------------------org.hibernate.type.AdaptedImmutableType
40: java.util.Currency---------------------org.hibernate.type.CurrencyType
41: binary---------------------org.hibernate.type.BinaryType
42: java.util.Calendar---------------------org.hibernate.type.CalendarType
43: locale---------------------org.hibernate.type.LocaleType
44: clob---------------------org.hibernate.type.ClobType
45: object---------------------org.hibernate.type.AnyType
46: date---------------------org.hibernate.type.DateType
47: imm_time---------------------org.hibernate.type.AdaptedImmutableType
48: [Ljava.lang.Character;---------------------org.hibernate.type.CharacterArrayType
49: currency---------------------org.hibernate.type.CurrencyType
50: character---------------------org.hibernate.type.CharacterType
51: timestamp---------------------org.hibernate.type.TimestampType
52: short---------------------org.hibernate.type.ShortType
53: calendar_date---------------------org.hibernate.type.CalendarDateType
54: java.util.GregorianCalendar---------------------org.hibernate.type.CalendarType
55: java.sql.Clob---------------------org.hibernate.type.ClobType
56: java.lang.Character---------------------org.hibernate.type.CharacterType
57: big_decimal---------------------org.hibernate.type.BigDecimalType
58: Character[]---------------------org.hibernate.type.CharacterArrayType
59: serializable---------------------org.hibernate.type.SerializableType
60: calendar---------------------org.hibernate.type.CalendarType
61: materialized_blob---------------------org.hibernate.type.MaterializedBlobType
62: Byte[]---------------------org.hibernate.type.WrapperBinaryType
63: imm_date---------------------org.hibernate.type.AdaptedImmutableType
64: [B---------------------org.hibernate.type.BinaryType
65: integer---------------------org.hibernate.type.IntegerType
66: java.lang.String---------------------org.hibernate.type.StringType
67: [C---------------------org.hibernate.type.CharArrayType
68: java.util.Date---------------------org.hibernate.type.TimestampType
69: true_false---------------------org.hibernate.type.TrueFalseType
70: blob---------------------org.hibernate.type.BlobType
71: imm_calendar---------------------org.hibernate.type.AdaptedImmutableType
72: imm_timestamp---------------------org.hibernate.type.AdaptedImmutableType
73: string---------------------org.hibernate.type.StringType
74: java.math.BigDecimal---------------------org.hibernate.type.BigDecimalType
75: byte[]---------------------org.hibernate.type.BinaryType
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值