Common types automatically generated by Hibernate primary keys

Source: Internet
Author: User

1. The Assigned primary key is generated inside the database without Hibernate intervention.

2. hilo requires additional database tables to save the Historical Status of the primary key generation.

3. increment maintains a variable in the instance to save the current maximum value. An error may occur when multiple instances are accessed.

4. identity uses the generation mechanism provided by the database, such as the auto-increment Primary Key Generation Mechanism in SQL Server and MySQL.

5. sequence uses the sequence generation mechanism provided by the database, if it is Oracle.

6. uuid. hex is generated by hibernate Based on the 128-bit unique value algorithm. The maximum guarantee is uniqueness, which may occur once in tens of thousands of years.

7. native uses different generation mechanisms for hibernate to automatically determine the database type, which is commonly used.

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.