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:

[Java]View PlainCopy
    1. @GenericGenerator (name = "System-uuid", strategy = "Uuid.hex")
    2. @Id
    3. @GeneratedValue (generator = "System-uuid")
    4. @Column (name = "user_id")
    5. Public String getUserId () {
    6. return userId;
    7. }

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

[Java]View PlainCopy
    1. @Id
    2. @Column (length = + , nullable = false)
    3. @GeneratedValue (generator = "Uuid2") //Specify Generator name
    4. @GenericGenerator (name = "Uuid2", strategy = "Org.hibernate.id.UUIDGenerator") //Generator name, uuid generation class

XML configuration:

The original:

[HTML]View PlainCopy
  1. <ID name="id" type= "string">
  2. <column name="ID" length=" /> "
  3. <generator class="uuid" />
  4. </ID>

Now after the change:

[HTML]View PlainCopy
  1. <ID name="id" type= "string">
  2. <column name="ID" length=" /> "
  3. <generator class="Uuid2" />
  4. </ID>

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

Related Article

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.