2007-03-22

[Note] Hibernate type

Hibernate typeJava typeSql type
Primitive type
characterjava.lang.Stringchar(1)
bytebyte, java.lang.Bytetinyint
shortshort, java.lang.Shortsmallint
integerint, java.lang.Integerinteger
longlong, java.lang.Longbigint
floatfloat, java.lang.Floatfloat
doubledouble, java.lang.Doubledouble
big_decimaljava.math.BigDecimalnumeric
stringjava.lang.Stringvarchar
booleanboolean, java.lang.Booleanbit*
yes_noboolean, java.lang.Booleanchar(1) 'Y' or 'N'
true_falseboolean, java.lang.Booleanchar(1) 'T' or 'F'
Temporal type
datejava.util.Date, java.sql.Datedate
timejava.util.Date, java.sql.Timetime
timestampjava.util.Date, java.sql.Timestamptimestamp
calendarjava.util.Calendartimestamp
calendar_datejava.util.Calendardate
Large type
binarybyte[]varbinary
textjava.lang.Stringclob
clobjava.sql.Clobclob
blobjava.sql.Blobblob
serializablejava.io.Serializable implementationsvarbinary
Other type
classjava.lang.Classvarchar
localejava.util.Localevarchar
timezonejava.util.TimeZonevarchar
currencyjava.util.Currencyvarchar

*在直接下sql時,bit會有問題!

沒有留言:

張貼留言