Hibernate type | Java type | Sql type |
Primitive type | ||
character | java.lang.String | char(1) |
byte | byte, java.lang.Byte | tinyint |
short | short, java.lang.Short | smallint |
integer | int, java.lang.Integer | integer |
long | long, java.lang.Long | bigint |
float | float, java.lang.Float | float |
double | double, java.lang.Double | double |
big_decimal | java.math.BigDecimal | numeric |
string | java.lang.String | varchar |
boolean | boolean, java.lang.Boolean | bit* |
yes_no | boolean, java.lang.Boolean | char(1) 'Y' or 'N' |
true_false | boolean, java.lang.Boolean | char(1) 'T' or 'F' |
Temporal type | ||
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 |
Large type | ||
binary | byte[] | varbinary |
text | java.lang.String | clob |
clob | java.sql.Clob | clob |
blob | java.sql.Blob | blob |
serializable | java.io.Serializable implementations | varbinary |
Other type | ||
class | java.lang.Class | varchar |
locale | java.util.Locale | varchar |
timezone | java.util.TimeZone | varchar |
currency | java.util.Currency | varchar |
*在直接下sql時,bit會有問題!
沒有留言:
張貼留言