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
- @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
[Java]View PlainCopy
- @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:
[HTML]View PlainCopy
- <ID name="id" type= "string">
- <column name="ID" length=" /> "
- <generator class="uuid" />
- </ID>
Now after the change:
[HTML]View PlainCopy
- <ID name="id" type= "string">
- <column name="ID" length=" /> "
- <generator class="Uuid2" />
- </ID>
Using Org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values;