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

标签:uuid hibernate

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

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

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

	@GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "system-uuid")
	@Column(name = "user_id")

	public String getUserId() { 
		return userId ;
	}
经查询,Hibernate 3.6开始,如果有model的主键有uuid生成,就会报这个错误,采用最新的生成策略,改成下面的就会正常

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

XML配置:

原来的:

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

现在改变后的:

<id name="id" type="string">
            <column name="ID" length="36" />
            <generator class="uuid2" />
        </id>



Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values;,布布扣,bubuko.com

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

标签:uuid hibernate

原文:http://blog.csdn.net/shanhuhau/article/details/38224619

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值