(2010-07-14 19:53:50)
reproduced
Tags: gossip |
Category: JAVA |
Hibernate API IntroductionIts interface is divided into the following categories: L provide access to the database operation interface; L interface for configuring Hibernate; L Callback interface L extend Hibernate's function. Most of these interfaces are located in the Net.sf.hibernate package
Hibernate's core interface5 Core interfaces: L Configuration Interface: Configure Hibernate, Root start Hibernate, create Sessionfactory objects. L Sessionfactory Interface: Initializes hibernate, acts as a proxy for the data storage source, and creates session objects. L Session Interface: Responsible for saving, updating, deleting, loading and querying objects. L Transaction: Management transactions. L Query and Criteria interface: Perform database queries. Sessionfactory instances correspond to a data storage source, characterized by: thread-safe, heavyweight. Session: Hibernate is the most widely used interface, features: not thread-safe, lightweight.
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,hibernate, the corresponding table between the standard SQL data types