Hibernate API IntroductionIts interface is divided into the following categories: lAn interface that provides access to the operation of the database;Lan interface for configuring hibernate;LCallback InterfaceLAn interface that extends hibernate's functionality. Most of these interfaces are located in the Net.sf.hibernate package
Hibernate 's core interface 5 Core interfaces: lConfiguration Interface: Configure Hibernate, Root start Hibernate, create Sessionfactory objects. LSessionfactory Interface: Initializes hibernate, acts as a proxy for the data storage source, and creates session objects. LSession Interface: Responsible for saving, updating, deleting, loading, and querying objects. LTransaction: Managing transactions. LQuery and Criteria interface: Execute a database query. Sessionfactory instance corresponds to a data storage source, features:thread-safe, heavyweight. Session: Is the most extensive hibernate application interface, features:not thread-safe, lightweight.
Java
data type, hibernate
data type, standard SQL
correspondence table between data types
| Java Data types |
Hibernate data type |
Standard SQL data types (PS: May vary for different db) |
| BYTE, Java.lang.Byte |
Byte |
TINYINT |
| Short, Java.lang.Short |
Short |
SMALLINT |
| int, Java.lang.Integer |
Integer |
Ingeger |
| Long, Java.lang.Long |
Long |
BIGINT |
| float, java.lang.Float |
Float |
FLOAT |
| Double, java.lang.Double |
Double |
DOUBLE |
| Java.math.BigDecimal |
Big_decimal |
NUMERIC |
| Char, Java.lang.Character |
Character |
CHAR (1) |
| Boolean, Java.lang.Boolean |
Boolean |
BIT |
| Java.lang.String |
String |
VARCHAR |
| Boolean, Java.lang.Boolean |
Yes_no |
CHAR (1) (' Y ' or ' N ') |
| Boolean, Java.lang.Boolean |
True_false |
CHAR (1) (' Y ' or ' N ') |
| Java.util.Date, Java.sql.Date |
Date |
DATE |
| Java.util.Date, Java.sql.Time |
Time |
Time |
| Java.util.Date, Java.sql.Timestamp |
Timestamp |
TIMESTAMP |
| Java.util.Calendar |
Calendar |
TIMESTAMP |
| Java.util.Calendar |
Calendar_date |
DATE |
| Byte[] |
Binary |
VARBINARY, BLOB |
| Java.lang.String |
Text |
Clob |
| Java.io.Serializable |
Serializable |
VARBINARY, BLOB |
| Java.sql.Clob |
Clob |
Clob |
| Java.sql.Blob |
Blob |
Blob |
| Java.lang.Class |
Class |
VARCHAR |
| Java.util.Locale |
Locale |
VARCHAR |
| Java.util.TimeZone |
TimeZone |
VARCHAR |
| Java.util.Currency |
Currency |
VARCHAR |
Java data types, hibernate data types, corresponding tables between standard SQL data types