Java data types, hibernate data types, corresponding tables between standard SQL data types

Source: Internet
Author: User
Tags locale

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.