Using Org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values;

Source: Internet
Author: User
Tags rfc

Project deployment, the following warnings are available during startup:

[WARN]: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; Consider using Org.hibernate.id.UUIDGenerator instead

To view the primary key generation strategy for the user class in your project:

@GenericGenerator (name = "System-uuid", strategy = "Uuid.hex") @Id @generatedvalue (generator = "System-uuid") @Column ( Name = "user_id") public String getUserId () {return userId;}
After the query, Hibernate 3.6, if there is a model of the primary key has the UUID generation, will report this error, using the latest generation strategy, change to the following will be normal

@Id @column (length = +, Nullable = False) @GeneratedValue (generator = "Uuid2")   //Specify Generator name @genericgenerator (name = " Uuid2 ", strategy =" org.hibernate.id.UUIDGenerator ")  //Generator name, UUID Generation class

XML configuration:

The original:

<id name= "id" type= "string" >       <column name= "id" length= "+"/> <generator       class= "uuid"/>   </id>

Now after the change:

<id name= "id" type= "string" >            <column name= "id" length= "$"/> <generator            class= "Uuid2"/>        </id>



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.