项目部署,启动过程中有以下警告:

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

查看项目中用户类的主键生成策略:

  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. }

经查询,Hibernate 3.6开始,如果有model的主键有uuid生成,就会报这个错误,采用最新的生成策略,改成下面的就会正常

  1. @Id
  2. @Column(length = 32, nullable = false)
  3. @GeneratedValue(generator = "uuid2" )   //指定生成器名称
  4. @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator" )  //生成器名称,uuid生成类

XML配置:

原来的:

  1. <id name="id" type="string">
  2. <column name="ID" length="32" />
  3. <generator class="uuid" />
  4. </id>

现在改变后的:

  1. <id name="id" type="string">
  2. <column name="ID" length="36" />
  3. <generator class="uuid2" />
  4. </id>

Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values;的更多相关文章

  1. 【hibernate】主键生成策略使用UUID报出如下警告:org.hibernate.id.UUIDHexGenerator - HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values;

    主键生成策略使用UUID报出如警告如下: 控制台- 2017-11-24 18:40:14 [restartedMain] WARN org.hibernate.id.UUIDHexGenerator ...

  2. org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String

    org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.Strin ...

  3. Hibernate —— ID的各种生成器(转)

    Hibernate中,<id>元素下的可选<generator>子元素是一个Java类的名字,用来为该持久化类的实例生成惟一标示,所有的生成器都实现net.sf.hiberna ...

  4. org.hibernate.id.IdentifierGenerationException

    [问题]org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned bef ...

  5. 异常:org.hibernate.id.IdentifierGenerationException

    在有关联关系的数据表中保存数据时,先保存一端,再保存多端的抛出的异常(此时不管一端,还是多端的对象都没有设置id,属性,也就是要保存的两个对象的id 属性为空.) org.hibernate.id.I ...

  6. org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

  7. org.hibernate.id.IdentifierGenerationException错误解决方法

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

  8. Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.qingmu.seller.entity.OrderMaster

    org.springframework.orm.jpa.JpaSystemException: ids for this class must be manually assigned before ...

  9. org.hibernate.id.IdentifierGenerationException: Hibernate异常

    异常信息: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned b ...

随机推荐

  1. pythonl学习笔记——爬虫的基本常识

    1 robots协议 Robots协议(也称为爬虫协议.机器人协议等)的全称是“网络爬虫排除标准”(Robots Exclusion Protocol),网站通过Robots协议告诉搜索引擎哪些页面可 ...

  2. tomcat在debug模式启动直接提示:弹框无法启动,无报错信息;但直接启动的话,就会有报错信息

    今天运行项目,Debug模式启动Tomcat,直接弹框:无法启动(翻译,因为后来整理,所以都忘记当时的截图) 后来尝试直接start,发现不弹框了,但是console有报出错信息. 类似以下错误 20 ...

  3. ie11 下 input 默认有 X 关闭按钮的问题

    &::-ms-clear, ::-ms-reveal{display: none;}

  4. Python 多进程 一分钟下载二百张图片 是什么样子的体验

    需要爬取国内某个网站,但是这个网站封ip,没办法,只能用代理了,然后构建自己的代理池,代理池维护了20条进程, 所用的网络是20M带宽,实际的网速能达到2.5M,考虑到其他原因,网速未必能达到那么多. ...

  5. Linux下的MongoDB安装配置以及基本用法示例

    一 MongoDB的安装配置 (1)下载并安装: MongoDB安装包下载地址:https://www.mongodb.com/download-center [root@localhost src] ...

  6. 简单易懂的laravel事件,这个功能非常的有用(监听事件,订阅者模式)

    先说一下在什么场景会使用这个事件功能. 事情大概是这样的,需求要在用户注册的时候发一些帮助邮件给用户(原本用户在注册之后已经有发别的邮件的了,短信,IM什么的) 原来这个注册的方法也就10多行代码.但 ...

  7. 每天一点儿Java--ComboBox

    import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; impor ...

  8. Correlation and Regression

    Correlation and Regression Sample Covariance The covariance between two random variables is a statis ...

  9. 腾讯云数据库团队:MySQL5.7 JSON实现简单介绍

    作者介绍:吴双桥 腾讯云project师 阅读原文.很多其它技术干货.请訪问fromSource=gwzcw.57435.57435.57435">腾云阁. 本文主要介绍在MySQL ...

  10. Python 2.7.9 Demo - 001.print_hello_world - 002.print_chinese

    001.print_hello_world #!/usr/bin/python print "hello, world..."; 002.print_chinese #coding ...