Hibernate number Precision

Source: Internet
Author: User

When you map an entity through hibernate, the corresponding primary key type in the corresponding Pojo class is generated based on the precision of the number type in the database. Following the results of the pro-test:

Number ( 1 )

A Boolean is generated in the Pojo class

Public class Test implements java.io.Serializable {

Fields

Private Boolean ID;

}

Number ( 2 )

A byte is generated in the Pojo class

Public class Test implements java.io.Serializable {

Private Byte ID;

}

Number ( 3 ) Number ( 4 )

Short

Number ( 5 ) Number ( 6 ) Number ( 7 ) Number ( 8 )

Number ( 9 )

Integer

Number ( Ten ) Number ( One ) Number ( A ) Number ( - )

Number ( - ) Number ( the ) Number ( - ) Number ( - )

Number ( - )

Long

Number ( + ) ----- Number ( - )

BigDecimal

When number has no precision, the default 38-bit

Transferred from: http://sunwws.iteye.com/blog/2044140

Hibernate number Precision

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.