| Mapping type |
Java type |
Standard SQL field type |
| Integer |
int or Java.lang.Integer |
INTEGER |
| Long |
Long or Java.lang.Long |
BIGINT |
| Short |
Short or Java.lang.Short |
SMALLINT |
| Float |
float or java.lang.Float |
FLOAT |
| Double |
Double or java.lang.Double |
DOUBLE |
| Big_decimal |
Java.math.BigDecimal |
NUMERIC |
| Character |
Java.lang.String |
CHAR (1) |
| String |
Java.lang.String |
VARCHAR |
| Byte |
byte or Java.lang.Byte |
TINYINT |
| Boolean |
Boolean or Java.lang.Boolean |
BIT |
| Yes_no |
Boolean or Java.lang.Boolean |
CHAR (1 (' Y ' or ' N ') |
| True_false |
Boolean or Java.lang.Boolean |
CHAR (1) (' Y ' or ' N ') |
| Date |
Java.util.Date or Java.sql.Date |
DATE |
| Time |
Java.util.Date or Java.sql.Time |
Time |
| Timestamp |
Java.util.Date or Java.sql.Timestamp |
TIMESTAMP |
| Calendar |
Java.util.Calendar |
TIMESTAMP |
| Calendar_date |
Java.util.Calendar |
DATE |
| Binary |
Byte[] |
VARBINARY (or BLOB) |
| Text |
Java.lang.String |
Clob |
| Serializable |
Any instance of java.io.Serializable |
VARBINARY (or BLOB) |
| Clob |
Java.sql.Clob |
Clob |
| Blob |
Java.sql.Blob |
Blob |
| Class |
Java.lang.Class |
VARCHAR |
| Locale |
Java.util.Locale |
VARCHAR |
| TimeZone |
Java.util.TimeZone |
VARCHAR |
| Currency |
Java.util.Currency |
VARCHAR |
|
|
|
Before using Oracle, regardless of the use of long,int,short,double anyway is the digital type of the Numeric,mysql data type seems to be differentiated relatively thin, the previous period of time with JEECG generated code when found always put my numeric (11) Type of field generated Ava.math.BigDecimal, each time you have to manually change the code, hehe.
Hibernate corresponds to MySQL field type