Hibernate annoation (four LOB)

Source: Internet
Author: User
Tags locale

Hiberante SQL mapping corresponds

Java Data types Hibernate data type Standard SQL data type

(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

One, for large characters, which is Colb,blob

The hibernate annoation can be used as follows:

 @Lob 
 public String getC() {
 return c;
 } 
 @Lob 
 public byte[] getB() {
 return b;
 }

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.