Hibernate ing type table
Java type |
Hibernate ing type |
SQL type |
Java. Math. bigdecimal |
Big_decimal |
Numeric |
Byte [] |
Binary |
Varbinary (BLOB) |
Boolean (Java. Lang. Boolean) |
Boolean |
Bit |
Byte (Java. Lang. byte) |
Byte |
Tinyint |
Java. util. Calendar |
Calendar |
Timestamp |
Java. SQL. clob |
Clob |
Clob |
Java. util. Date or Java. SQL. Date |
Date |
Date |
Double (Java. Lang. Double) |
Double |
Double |
Float (Java. Lang. Float) |
Float |
Float |
INT (Java. Lang. integer) |
Integer |
Integer |
Java. util. Local |
Local |
Varchar |
Long (Java. Lang. Long) |
Long |
Bigint |
An instance of Java. Io. serializable |
Serializable |
Varbinary (or blob) |
Java. Lang. String |
String |
Varchar |
Java. Lang. String |
Text |
Clob |
Java. util. Date or Java. SQL. Timestamp |
Time |
Timestamp |
Copy the table from the book for future reference.
Considering that the operations on BLOB fields are too complicated, a transformation technique is that object classes use the byte [] type, Hibernate type uses binary, and database uses blob. This can simplify some operations.